Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p-quic-transport
Commits
9b34ef78
Commit
9b34ef78
authored
Jun 06, 2018
by
Marten Seemann
Browse files
use the same quic.Config values for dialing and listening
parent
1703ae03
Changes
2
Show whitespace changes
Inline
Side-by-side
listener.go
View file @
9b34ef78
...
...
@@ -33,7 +33,7 @@ func newListener(addr ma.Multiaddr, transport tpt.Transport, localPeer peer.ID,
if
err
!=
nil
{
return
nil
,
err
}
ln
,
err
:=
quicListenAddr
(
host
,
tlsConf
,
&
quic
.
Config
{
Versions
:
[]
quic
.
VersionNumber
{
101
}}
)
ln
,
err
:=
quicListenAddr
(
host
,
tlsConf
,
quicConfig
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
transport.go
View file @
9b34ef78
...
...
@@ -15,6 +15,12 @@ import (
"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
// 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
}
return
nil
}
sess
,
err
:=
quicDialAddr
(
host
,
tlsConf
,
&
quic
.
Config
{
Versions
:
[]
quic
.
VersionNumber
{
101
}}
)
sess
,
err
:=
quicDialAddr
(
host
,
tlsConf
,
quicConfig
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment