fix logic error

This commit is contained in:
Ștefan Talpalaru 2019-04-29 17:32:37 +02:00
parent 4fbb4603fc
commit 05bf76c537
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
1 changed files with 3 additions and 4 deletions

View File

@ -118,13 +118,12 @@ proc doPortMapping(tcpPort, udpPort: Port, description: string): Option[(Port, P
if cres.isErr: if cres.isErr:
warn "UPnP port mapping check failed. Assuming the check itself is broken and the port mapping was done.", msg = cres.error warn "UPnP port mapping check failed. Assuming the check itself is broken and the port mapping was done.", msg = cres.error
let extPort = Port(parseUInt(cres.value.externalPort)) debug "UPnP: added port mapping", externalPort = port, internalPort = port, protocol = protocol
debug "UPnP: added port mapping", externalPort = extPort, internalPort = port, protocol = protocol
case protocol: case protocol:
of UPNPProtocol.TCP: of UPNPProtocol.TCP:
extTcpPort = extPort extTcpPort = port
of UPNPProtocol.UDP: of UPNPProtocol.UDP:
extUdpPort = extPort extUdpPort = port
elif strategy == NatPmp: elif strategy == NatPmp:
for t in [(tcpPort, NatPmpProtocol.TCP), (udpPort, NatPmpProtocol.UDP)]: for t in [(tcpPort, NatPmpProtocol.TCP), (udpPort, NatPmpProtocol.UDP)]:
let let