Commit 2b8f3530 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

disable utp for now (broken)

parent 13314e3a
...@@ -4,7 +4,7 @@ import ( ...@@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"net" "net"
utp "github.com/jbenet/go-multiaddr-net/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-multiaddr-net/Godeps/_workspace/src/github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
) )
...@@ -112,16 +112,18 @@ func (d *Dialer) Dial(remote ma.Multiaddr) (Conn, error) { ...@@ -112,16 +112,18 @@ func (d *Dialer) Dial(remote ma.Multiaddr) (Conn, error) {
return nil, err return nil, err
} }
case "utp": case "utp":
// construct utp dialer, with options on our net.Dialer return nil, fmt.Errorf("utp is currently broken")
utpd := utp.Dialer{
Timeout: d.Dialer.Timeout, // // construct utp dialer, with options on our net.Dialer
LocalAddr: d.Dialer.LocalAddr, // utpd := utp.Dialer{
} // Timeout: d.Dialer.Timeout,
// LocalAddr: d.Dialer.LocalAddr,
nconn, err = utpd.Dial(rnet, rnaddr) // }
if err != nil { //
return nil, err // nconn, err = utpd.Dial(rnet, rnaddr)
} // if err != nil {
// return nil, err
// }
} }
// get local address (pre-specified or assigned within net.Conn) // get local address (pre-specified or assigned within net.Conn)
...@@ -225,7 +227,8 @@ func Listen(laddr ma.Multiaddr) (Listener, error) { ...@@ -225,7 +227,8 @@ func Listen(laddr ma.Multiaddr) (Listener, error) {
var nl net.Listener var nl net.Listener
switch lnet { switch lnet {
case "utp": case "utp":
nl, err = utp.Listen(lnet, lnaddr) // nl, err = utp.Listen(lnet, lnaddr)
return nil, fmt.Errorf("utp is currently broken")
default: default:
nl, err = net.Listen(lnet, lnaddr) nl, err = net.Listen(lnet, lnaddr)
} }
......
...@@ -165,7 +165,7 @@ func TestListenAddrs(t *testing.T) { ...@@ -165,7 +165,7 @@ func TestListenAddrs(t *testing.T) {
test("/ip4/127.0.0.1/tcp/4324", true) 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/4325", false)
test("/ip4/127.0.0.1/udp/4326/udt", 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) { func TestListenAndDial(t *testing.T) {
...@@ -230,6 +230,7 @@ func TestListenAndDial(t *testing.T) { ...@@ -230,6 +230,7 @@ func TestListenAndDial(t *testing.T) {
} }
func TestListenAndDialUTP(t *testing.T) { func TestListenAndDialUTP(t *testing.T) {
t.Skip("utp is broken")
maddr := newMultiaddr(t, "/ip4/127.0.0.1/udp/4323/utp") maddr := newMultiaddr(t, "/ip4/127.0.0.1/udp/4323/utp")
listener, err := Listen(maddr) listener, err := Listen(maddr)
......
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