Commit 9b34ef78 authored by Marten Seemann's avatar Marten Seemann
Browse files

use the same quic.Config values for dialing and listening

parent 1703ae03
...@@ -33,7 +33,7 @@ func newListener(addr ma.Multiaddr, transport tpt.Transport, localPeer peer.ID, ...@@ -33,7 +33,7 @@ func newListener(addr ma.Multiaddr, transport tpt.Transport, localPeer peer.ID,
if err != nil { if err != nil {
return nil, err return nil, err
} }
ln, err := quicListenAddr(host, tlsConf, &quic.Config{Versions: []quic.VersionNumber{101}}) ln, err := quicListenAddr(host, tlsConf, quicConfig)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -15,6 +15,12 @@ import ( ...@@ -15,6 +15,12 @@ import (
"github.com/whyrusleeping/mafmt" "github.com/whyrusleeping/mafmt"
) )
var quicConfig = &quic.Config{
MaxReceiveStreamFlowControlWindow: 3 * (1 << 20), // 3 MB
MaxReceiveConnectionFlowControlWindow: 4.5 * (1 << 20), // 4.5 MB
Versions: []quic.VersionNumber{101},
}
var quicDialAddr = quic.DialAddr var quicDialAddr = quic.DialAddr
// The Transport implements the tpt.Transport interface for QUIC connections. // The Transport implements the tpt.Transport interface for QUIC connections.
...@@ -70,7 +76,7 @@ func (t *transport) Dial(ctx context.Context, raddr ma.Multiaddr, p peer.ID) (tp ...@@ -70,7 +76,7 @@ func (t *transport) Dial(ctx context.Context, raddr ma.Multiaddr, p peer.ID) (tp
} }
return nil return nil
} }
sess, err := quicDialAddr(host, tlsConf, &quic.Config{Versions: []quic.VersionNumber{101}}) sess, err := quicDialAddr(host, tlsConf, quicConfig)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment