This commit is contained in:
Neil Alexander 2020-06-09 13:41:17 +01:00
parent e2d9f86569
commit 566d37ec01
2 changed files with 2 additions and 38 deletions

View file

@ -72,15 +72,11 @@ func createFederationClient(
yggdialerctx := func(ctx context.Context, network, address string) (net.Conn, error) { yggdialerctx := func(ctx context.Context, network, address string) (net.Conn, error) {
return yggdialer(network, address) return yggdialer(network, address)
} }
tr := &http.Transport{}
tr := &http.Transport{
MaxConnsPerHost: 1,
}
tr.RegisterProtocol( tr.RegisterProtocol(
"matrix", &yggroundtripper{ "matrix", &yggroundtripper{
inner: &http.Transport{ inner: &http.Transport{
DialContext: yggdialerctx, DialContext: yggdialerctx,
MaxConnsPerHost: 1,
}, },
}, },
) )

View file

@ -1,32 +0,0 @@
package yggconn
import (
"github.com/libp2p/go-yamux"
)
type stream struct {
*yamux.Stream
//conn net.Conn
}
/*
func (c *stream) LocalAddr() net.Addr {
return c.LocalAddr()
}
func (c *stream) RemoteAddr() net.Addr {
return c.conn.RemoteAddr()
}
func (c *stream) SetDeadline(t time.Time) error {
return c.conn.SetDeadline(t)
}
func (c *stream) SetReadDeadline(t time.Time) error {
return c.conn.SetReadDeadline(t)
}
func (c *stream) SetWriteDeadline(t time.Time) error {
return c.conn.SetWriteDeadline(t)
}
*/