Nutss does not use sequence numbers
This commit is contained in:
parent
b7837c43e6
commit
9e96dd5c78
|
@ -27,7 +27,7 @@ type
|
||||||
publicPorts: seq[Port]
|
publicPorts: seq[Port]
|
||||||
|
|
||||||
# Punchd messages
|
# Punchd messages
|
||||||
ProgressTcpSyniConnect* = object
|
Progress* = object
|
||||||
command: string
|
command: string
|
||||||
args: string
|
args: string
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ type
|
||||||
srcPorts: seq[Port]
|
srcPorts: seq[Port]
|
||||||
dstIp: IpAddress
|
dstIp: IpAddress
|
||||||
dstPorts: seq[Port]
|
dstPorts: seq[Port]
|
||||||
seqNumbers: seq[uint32]
|
#seqNumbers: seq[uint32]
|
||||||
|
|
||||||
# Exceptions
|
# Exceptions
|
||||||
PunchdError = object of ValueError # FIXME: not used yet
|
PunchdError = object of ValueError # FIXME: not used yet
|
||||||
|
@ -141,8 +141,8 @@ proc handlePeerNotifications(serverConn: ServerConnection,
|
||||||
echo "received message from ", msg.sender
|
echo "received message from ", msg.sender
|
||||||
let srcPorts = msg.srcPorts.join(",")
|
let srcPorts = msg.srcPorts.join(",")
|
||||||
let dstPorts = msg.dstPorts.join(",")
|
let dstPorts = msg.dstPorts.join(",")
|
||||||
let seqNumbers = msg.seqNumbers.join(",")
|
#let seqNumbers = msg.seqNumbers.join(",")
|
||||||
let req = &"{msg.srcIp}|{srcPorts}|{msg.dstIp}|{dstPorts}|{seqNumbers}"
|
let req = &"{msg.srcIp}|{srcPorts}|{msg.dstIp}|{dstPorts}"
|
||||||
asyncCheck acceptConnection(punchdConn, msg.command, req)
|
asyncCheck acceptConnection(punchdConn, msg.command, req)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
echo e.msg
|
echo e.msg
|
||||||
|
@ -155,7 +155,7 @@ proc punchHole(punchdConn: PunchdConnection, serverConn: ServerConnection,
|
||||||
let peerInfo = parseMessage[OkGetPeerinfo](sResp)
|
let peerInfo = parseMessage[OkGetPeerinfo](sResp)
|
||||||
proc progressCb(future: PunchdResponse, msgContent: string) {.async.} =
|
proc progressCb(future: PunchdResponse, msgContent: string) {.async.} =
|
||||||
try:
|
try:
|
||||||
let parsedResp = parseMessage[ProgressTcpSyniConnect](msgContent)
|
let parsedResp = parseMessage[Progress](msgContent)
|
||||||
let req = &"{peerId}|{otherPeerId}|{parsedResp.command}|{parsedResp.args}"
|
let req = &"{peerId}|{otherPeerId}|{parsedResp.command}|{parsedResp.args}"
|
||||||
discard await serverConn.sendRequest("notify-peer", req)
|
discard await serverConn.sendRequest("notify-peer", req)
|
||||||
except ServerError as e:
|
except ServerError as e:
|
||||||
|
|
Loading…
Reference in New Issue