From 62637ce52dbf885ce54632c82dec2de97e584ee3 Mon Sep 17 00:00:00 2001 From: Denis Kuzmenok Date: Tue, 19 Jun 2018 15:49:20 +0300 Subject: [PATCH] moving upnp to a separate repository --- portfwd.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/portfwd.go b/portfwd.go index c9229630..301308f6 100644 --- a/portfwd.go +++ b/portfwd.go @@ -5,11 +5,11 @@ import ( "time" flog "github.com/anacrolix/log" - "github.com/syncthing/syncthing/lib/nat" - "github.com/syncthing/syncthing/lib/upnp" + + "github.com/elgatito/upnp" ) -func addPortMapping(d nat.Device, proto nat.Protocol, internalPort int, debug bool) { +func addPortMapping(d upnp.Device, proto upnp.Protocol, internalPort int, debug bool) { externalPort, err := d.AddPortMapping(proto, internalPort, internalPort, "anacrolix/torrent", 0) if err != nil { log.Printf("error adding %s port mapping: %s", proto, err) @@ -33,8 +33,8 @@ func (cl *Client) forwardPort() { port := cl.incomingPeerPort() cl.mu.Unlock() for _, d := range ds { - go addPortMapping(d, nat.TCP, port, cl.config.Debug) - go addPortMapping(d, nat.UDP, port, cl.config.Debug) + go addPortMapping(d, upnp.TCP, port, cl.config.Debug) + go addPortMapping(d, upnp.UDP, port, cl.config.Debug) } cl.mu.Lock() } -- 2.48.1