aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-04-04 15:16:02 +0100
committerNeil Alexander <neilalexander@users.noreply.github.com>2022-04-04 15:16:02 +0100
commitc69159bda751afe035d33ddd13ae40e0283988b3 (patch)
tree260d3d321277527c1330fdb4ece574b6264d1858 /cmd
parent9b316ac64ce4ff0abee497e9c69204c4eb9102eb (diff)
Update to matrix-org/pinecone@e526fa8
Diffstat (limited to 'cmd')
-rw-r--r--cmd/dendrite-demo-pinecone/conn/client.go17
-rw-r--r--cmd/dendrite-demo-pinecone/main.go12
2 files changed, 14 insertions, 15 deletions
diff --git a/cmd/dendrite-demo-pinecone/conn/client.go b/cmd/dendrite-demo-pinecone/conn/client.go
index 59de9690..27e18c2a 100644
--- a/cmd/dendrite-demo-pinecone/conn/client.go
+++ b/cmd/dendrite-demo-pinecone/conn/client.go
@@ -67,21 +67,22 @@ func (y *RoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
}
func createTransport(s *pineconeSessions.Sessions) *http.Transport {
+ proto := s.Protocol("matrix")
tr := &http.Transport{
DisableKeepAlives: false,
- Dial: s.Dial,
- DialContext: s.DialContext,
- DialTLS: s.DialTLS,
- DialTLSContext: s.DialTLSContext,
+ Dial: proto.Dial,
+ DialContext: proto.DialContext,
+ DialTLS: proto.DialTLS,
+ DialTLSContext: proto.DialTLSContext,
}
tr.RegisterProtocol(
"matrix", &RoundTripper{
inner: &http.Transport{
DisableKeepAlives: false,
- Dial: s.Dial,
- DialContext: s.DialContext,
- DialTLS: s.DialTLS,
- DialTLSContext: s.DialTLSContext,
+ Dial: proto.Dial,
+ DialContext: proto.DialContext,
+ DialTLS: proto.DialTLS,
+ DialTLSContext: proto.DialTLSContext,
},
},
)
diff --git a/cmd/dendrite-demo-pinecone/main.go b/cmd/dendrite-demo-pinecone/main.go
index 122da1c5..5c086b7e 100644
--- a/cmd/dendrite-demo-pinecone/main.go
+++ b/cmd/dendrite-demo-pinecone/main.go
@@ -22,7 +22,6 @@ import (
"flag"
"fmt"
"io/ioutil"
- "log"
"net"
"net/http"
"os"
@@ -91,8 +90,7 @@ func main() {
pk = sk.Public().(ed25519.PublicKey)
}
- logger := log.New(os.Stdout, "", 0)
- pRouter := pineconeRouter.NewRouter(logger, sk, false)
+ pRouter := pineconeRouter.NewRouter(logrus.WithField("pinecone", "router"), sk, false)
go func() {
listener, err := net.Listen("tcp", *instanceListen)
@@ -122,8 +120,8 @@ func main() {
}
}()
- pQUIC := pineconeSessions.NewSessions(logger, pRouter)
- pMulticast := pineconeMulticast.NewMulticast(logger, pRouter)
+ pQUIC := pineconeSessions.NewSessions(logrus.WithField("pinecone", "sessions"), pRouter, []string{"matrix"})
+ pMulticast := pineconeMulticast.NewMulticast(logrus.WithField("pinecone", "multicast"), pRouter)
pMulticast.Start()
connectToStaticPeer := func() {
@@ -253,7 +251,7 @@ func main() {
pMux.PathPrefix(httputil.PublicFederationPathPrefix).Handler(base.PublicFederationAPIMux)
pMux.PathPrefix(httputil.PublicMediaPathPrefix).Handler(base.PublicMediaAPIMux)
- pHTTP := pQUIC.HTTP()
+ pHTTP := pQUIC.Protocol("matrix").HTTP()
pHTTP.Mux().Handle(users.PublicURL, pMux)
pHTTP.Mux().Handle(httputil.PublicFederationPathPrefix, pMux)
pHTTP.Mux().Handle(httputil.PublicMediaPathPrefix, pMux)
@@ -275,7 +273,7 @@ func main() {
go func() {
pubkey := pRouter.PublicKey()
logrus.Info("Listening on ", hex.EncodeToString(pubkey[:]))
- logrus.Fatal(httpServer.Serve(pQUIC))
+ logrus.Fatal(httpServer.Serve(pQUIC.Protocol("matrix")))
}()
go func() {
httpBindAddr := fmt.Sprintf(":%d", *instancePort)