Merge remote-tracking branch 'origin/master' into stdout_loglevel

This commit is contained in:
Martin Ashby 2021-12-07 11:53:43 +00:00
commit 350954cebe
No known key found for this signature in database
GPG key ID: 7C2A95403085B982
2 changed files with 1 additions and 10 deletions

View file

@ -21,7 +21,6 @@ import (
"io" "io"
"net" "net"
"net/http" "net/http"
"net/url"
"os" "os"
"os/signal" "os/signal"
"syscall" "syscall"
@ -79,7 +78,6 @@ type BaseDendrite struct {
SynapseAdminMux *mux.Router SynapseAdminMux *mux.Router
UseHTTPAPIs bool UseHTTPAPIs bool
apiHttpClient *http.Client apiHttpClient *http.Client
httpClient *http.Client
Cfg *config.Dendrite Cfg *config.Dendrite
Caches *caching.Caches Caches *caching.Caches
DNSCache *gomatrixserverlib.DNSCache DNSCache *gomatrixserverlib.DNSCache
@ -183,13 +181,6 @@ func NewBaseDendrite(cfg *config.Dendrite, componentName string, options ...Base
}, },
}, },
} }
client := http.Client{Timeout: HTTPClientTimeout}
if cfg.FederationAPI.Proxy.Enabled {
client.Transport = &http.Transport{Proxy: http.ProxyURL(&url.URL{
Scheme: cfg.FederationAPI.Proxy.Protocol,
Host: fmt.Sprintf("%s:%d", cfg.FederationAPI.Proxy.Host, cfg.FederationAPI.Proxy.Port),
})}
}
// Ideally we would only use SkipClean on routes which we know can allow '/' but due to // Ideally we would only use SkipClean on routes which we know can allow '/' but due to
// https://github.com/gorilla/mux/issues/460 we have to attach this at the top router. // https://github.com/gorilla/mux/issues/460 we have to attach this at the top router.
@ -219,7 +210,6 @@ func NewBaseDendrite(cfg *config.Dendrite, componentName string, options ...Base
InternalAPIMux: mux.NewRouter().SkipClean(true).PathPrefix(httputil.InternalPathPrefix).Subrouter().UseEncodedPath(), InternalAPIMux: mux.NewRouter().SkipClean(true).PathPrefix(httputil.InternalPathPrefix).Subrouter().UseEncodedPath(),
SynapseAdminMux: mux.NewRouter().SkipClean(true).PathPrefix("/_synapse/").Subrouter().UseEncodedPath(), SynapseAdminMux: mux.NewRouter().SkipClean(true).PathPrefix("/_synapse/").Subrouter().UseEncodedPath(),
apiHttpClient: &apiClient, apiHttpClient: &apiClient,
httpClient: &client,
} }
} }

View file

@ -74,6 +74,7 @@ func NewOutputTypingEventConsumer(
func (s *OutputTypingEventConsumer) Start() error { func (s *OutputTypingEventConsumer) Start() error {
s.eduCache.SetTimeoutCallback(func(userID, roomID string, latestSyncPosition int64) { s.eduCache.SetTimeoutCallback(func(userID, roomID string, latestSyncPosition int64) {
pos := types.StreamPosition(latestSyncPosition) pos := types.StreamPosition(latestSyncPosition)
s.stream.Advance(pos)
s.notifier.OnNewTyping(roomID, types.StreamingToken{TypingPosition: pos}) s.notifier.OnNewTyping(roomID, types.StreamingToken{TypingPosition: pos})
}) })
return s.typingConsumer.Start() return s.typingConsumer.Start()