Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Commit

Permalink
disable utp on fallback dialer
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping committed Jun 15, 2016
1 parent ee85eb8 commit 8824400
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gx/lastpubver
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0: Qme5FbqN4BteaBcpbsj51fjzvqJhr54DigbqWAdXS5zgEe
1.3.0: QmaNko8ug5seuo61TnmW8jcVtCVgD6uR454wagU7PPKVWA
7 changes: 3 additions & 4 deletions fallback.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@ type FallbackDialer struct {
}

func (fbd *FallbackDialer) Matches(a ma.Multiaddr) bool {
return mafmt.TCP.Matches(a) || mafmt.UTP.Matches(a)
return mafmt.TCP.Matches(a)
}

func (fbd *FallbackDialer) Dial(a ma.Multiaddr) (Conn, error) {
if mafmt.TCP.Matches(a) {
return fbd.tcpDial(a)
}
if mafmt.UTP.Matches(a) {
return fbd.utpDial(a)
}
return nil, fmt.Errorf("cannot dial %s with fallback dialer", a)
}

Expand All @@ -41,6 +38,8 @@ func (fbd *FallbackDialer) tcpDial(raddr ma.Multiaddr) (Conn, error) {
}, nil
}

// NOTE: this code is currently not in use. utp is not stable enough for prolonged
// use on the network, and causes random stalls in the stack.
func (fbd *FallbackDialer) utpDial(raddr ma.Multiaddr) (Conn, error) {
_, addr, err := manet.DialArgs(raddr)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@
"language": "go",
"license": "MIT",
"name": "go-libp2p-transport",
"version": "1.2.0"
"version": "1.3.0"
}

0 comments on commit 8824400

Please sign in to comment.