1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-29 17:36:38 +08:00

updated go-multiaddr-net (disabled utp)

This commit is contained in:
Juan Batiz-Benet
2015-01-09 06:10:46 -08:00
parent 19a5f088d5
commit e1a0486e15
6 changed files with 21 additions and 17 deletions

2
Godeps/Godeps.json generated
View File

@ -127,7 +127,7 @@
},
{
"ImportPath": "github.com/jbenet/go-multiaddr-net",
"Rev": "b6265d8119558acf3912db44abb34d97c30c3220"
"Rev": "2b8f35303d2855c79f9f3f9b3584338a1ff7edbd"
},
{
"ImportPath": "github.com/jbenet/go-multihash",

View File

@ -11,8 +11,8 @@
},
{
"ImportPath": "github.com/jbenet/go-multiaddr",
"Comment": "0.1.2-30-g99cf3ed",
"Rev": "99cf3edc711751cf7b43505fac0e3913f6b9a75c"
"Comment": "0.1.2-34-g0d7b54b",
"Rev": "0d7b54ba432fda14bac37cdad717bd6270eacc85"
}
]
}

View File

@ -10,8 +10,8 @@ import (
manet "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net"
)
// flags
var formats = []string{"string", "bytes", "hex", "slice"}
var formats = []string{"string", "bytes", // flags
"hex", "slice"}
var format string
var hideLoopback bool

View File

@ -4,7 +4,7 @@ import (
"fmt"
"net"
utp "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/h2so5/utp"
// utp "github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/h2so5/utp"
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
)
@ -112,16 +112,18 @@ func (d *Dialer) Dial(remote ma.Multiaddr) (Conn, error) {
return nil, err
}
case "utp":
// construct utp dialer, with options on our net.Dialer
utpd := utp.Dialer{
Timeout: d.Dialer.Timeout,
LocalAddr: d.Dialer.LocalAddr,
}
return nil, fmt.Errorf("utp is currently broken")
nconn, err = utpd.Dial(rnet, rnaddr)
if err != nil {
return nil, err
}
// // construct utp dialer, with options on our net.Dialer
// utpd := utp.Dialer{
// Timeout: d.Dialer.Timeout,
// LocalAddr: d.Dialer.LocalAddr,
// }
//
// nconn, err = utpd.Dial(rnet, rnaddr)
// if err != nil {
// return nil, err
// }
}
// get local address (pre-specified or assigned within net.Conn)
@ -225,7 +227,8 @@ func Listen(laddr ma.Multiaddr) (Listener, error) {
var nl net.Listener
switch lnet {
case "utp":
nl, err = utp.Listen(lnet, lnaddr)
// nl, err = utp.Listen(lnet, lnaddr)
return nil, fmt.Errorf("utp is currently broken")
default:
nl, err = net.Listen(lnet, lnaddr)
}

View File

@ -165,7 +165,7 @@ func TestListenAddrs(t *testing.T) {
test("/ip4/127.0.0.1/tcp/4324", true)
test("/ip4/127.0.0.1/udp/4325", false)
test("/ip4/127.0.0.1/udp/4326/udt", false)
test("/ip4/127.0.0.1/udp/4326/utp", true)
// test("/ip4/127.0.0.1/udp/4326/utp", true)
}
func TestListenAndDial(t *testing.T) {
@ -230,6 +230,7 @@ func TestListenAndDial(t *testing.T) {
}
func TestListenAndDialUTP(t *testing.T) {
t.Skip("utp is broken")
maddr := newMultiaddr(t, "/ip4/127.0.0.1/udp/4323/utp")
listener, err := Listen(maddr)