Commit eb50900f authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

updated multiaddr-net for WrapNetListener

parent 7a322c95
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
}, },
{ {
"ImportPath": "github.com/jbenet/go-multiaddr-net", "ImportPath": "github.com/jbenet/go-multiaddr-net",
"Rev": "04044c2289504304472715d827a8f564fa3759a8" "Rev": "eae26b653a87d02193bb261ae5c5e1f39cc033d6"
}, },
{ {
"ImportPath": "github.com/jbenet/go-multihash", "ImportPath": "github.com/jbenet/go-multihash",
......
...@@ -236,13 +236,17 @@ func Listen(laddr ma.Multiaddr) (Listener, error) { ...@@ -236,13 +236,17 @@ func Listen(laddr ma.Multiaddr) (Listener, error) {
return nil, err return nil, err
} }
// we need to fetch the new multiaddr from the listener, as it // we want to fetch the new multiaddr from the listener, as it may
// may have resolved to some other value. // have resolved to some other value. WrapNetListener does it for us.
nladdr, err := FromNetAddr(nl.Addr()) return WrapNetListener(nl)
}
// WrapNetListener wraps a net.Listener with a manet.Listener.
func WrapNetListener(nl net.Listener) (Listener, error) {
laddr, err := FromNetAddr(nl.Addr())
if err != nil { if err != nil {
return nil, err return nil, err
} }
laddr = nladdr
return &maListener{ return &maListener{
Listener: nl, Listener: nl,
......
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