get-info -> get-peerinfo
This commit is contained in:
parent
3d40ddec85
commit
7c010f9303
|
@ -31,7 +31,7 @@ type
|
|||
args: string
|
||||
|
||||
# Server messages
|
||||
OkGetInfo* = object
|
||||
OkGetPeerinfo* = object
|
||||
ip: string
|
||||
ports: array[3, uint16]
|
||||
OkGetEndpoint* = object
|
||||
|
@ -147,8 +147,8 @@ proc handlePeerNotifications(serverConn: ServerConnection,
|
|||
proc punchHole(punchdConn: PunchdConnection, serverConn: ServerConnection,
|
||||
peerId: string, otherPeerId: string):
|
||||
Future[AsyncSocket] {.async.} =
|
||||
let sResp = await serverConn.sendRequest("get-info", otherPeerId)
|
||||
let peerInfo = parseMessage[OkGetInfo](sResp)
|
||||
let sResp = await serverConn.sendRequest("get-peerinfo", otherPeerId)
|
||||
let peerInfo = parseMessage[OkGetPeerinfo](sResp)
|
||||
proc progressCb(future: PunchdResponse, msgContent: string) {.async.} =
|
||||
try:
|
||||
let parsedResp = parseMessage[ProgressTcpSyniConnect](msgContent)
|
||||
|
|
|
@ -17,7 +17,7 @@ type
|
|||
ip: IpAddress
|
||||
ports: array[3, Port]
|
||||
|
||||
GetInfo = object
|
||||
GetPeerinfo = object
|
||||
peerId: string
|
||||
|
||||
NotifyPeer = object
|
||||
|
@ -94,9 +94,8 @@ proc processClient(client: AsyncSocket,
|
|||
asyncCheck client.sendEndpoint(id)
|
||||
removeClient(clients, peerId)
|
||||
break
|
||||
# FIXME: get-peerinfo
|
||||
of "get-info":
|
||||
let req = parseMessage[GetInfo](args[2])
|
||||
of "get-peerinfo":
|
||||
let req = parseMessage[GetPeerinfo](args[2])
|
||||
echo "get-info: ", req
|
||||
let peer = clients[req.peerId]
|
||||
let peerPorts = peer.ports.join(",")
|
||||
|
|
Loading…
Reference in New Issue