mirror of
https://github.com/vacp2p/nim-libp2p.git
synced 2026-01-10 11:18:08 -05:00
Compare commits
2 Commits
async-fix
...
pwhite/mix
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f1b5b7fb6 | ||
|
|
19758fbd4d |
@@ -9,7 +9,7 @@ skipDirs = @["tests", "examples", "Nim", "tools", "scripts", "docs"]
|
||||
|
||||
requires "nim >= 2.0.0",
|
||||
"nimcrypto >= 0.6.0 & < 0.7.0", "dnsclient >= 0.3.0 & < 0.4.0", "bearssl >= 0.2.5",
|
||||
"chronicles >= 0.11.0 & < 0.12.0", "chronos >= 4.0.4", "metrics", "secp256k1",
|
||||
"chronicles >= 0.11.0", "chronos >= 4.0.4", "metrics", "secp256k1",
|
||||
"stew >= 0.4.0", "websock >= 0.2.0", "unittest2", "results", "quic >= 0.2.15",
|
||||
"https://github.com/vacp2p/nim-jwt.git#18f8378de52b241f321c1f9ea905456e89b95c6f"
|
||||
|
||||
|
||||
@@ -275,6 +275,9 @@ proc broadcast*(
|
||||
else:
|
||||
# Fast path that only encodes message once
|
||||
let encoded = encodeRpcMsg(msg, p.anonymize)
|
||||
|
||||
info "SEND ENCODED MSG 1", data = shortLog(msg), useCustomConn, isHighPriority
|
||||
|
||||
for peer in sendPeers:
|
||||
asyncSpawn peer.sendEncoded(encoded, isHighPriority, useCustomConn)
|
||||
|
||||
|
||||
@@ -545,9 +545,11 @@ proc send*(
|
||||
if encoded.len > p.maxMessageSize and msg.messages.len > 1:
|
||||
for encodedSplitMsg in splitRPCMsg(p, msg, p.maxMessageSize, anonymize):
|
||||
asyncSpawn p.sendEncoded(encodedSplitMsg, isHighPriority, useCustomConn)
|
||||
info "SEND ENCODED MSG 2", data = shortLog(msg), useCustomConn, isHighPriority
|
||||
else:
|
||||
# If the message size is within limits, send it as is
|
||||
trace "sending msg to peer", peer = p, rpcMsg = shortLog(msg)
|
||||
info "SEND ENCODED MSG 3", data = shortLog(msg), useCustomConn, isHighPriority
|
||||
asyncSpawn p.sendEncoded(encoded, isHighPriority, useCustomConn)
|
||||
|
||||
proc canAskIWant*(p: PubSubPeer, msgId: MessageId): bool =
|
||||
|
||||
Reference in New Issue
Block a user