* ORC: track escaping parameters properly * fixes #18240
This commit is contained in:
parent
0d194cdbf9
commit
ceb9e3efc9
2 changed files with 57 additions and 12 deletions
|
|
@ -32,3 +32,35 @@ when true:
|
|||
waitFor hello(Flags())
|
||||
echo "success"
|
||||
|
||||
# bug #18240
|
||||
import tables
|
||||
|
||||
type
|
||||
TopicHandler* = proc(topic: string,
|
||||
data: seq[byte]): Future[void] {.gcsafe, raises: [Defect].}
|
||||
|
||||
PeerID* = object
|
||||
data*: seq[byte]
|
||||
|
||||
PeerInfo* = ref object of RootObj
|
||||
peerId*: PeerID
|
||||
|
||||
Connection* = ref object of RootObj
|
||||
peerInfo*: PeerInfo
|
||||
|
||||
PubSubPeer* = ref object of RootObj
|
||||
codec*: string
|
||||
|
||||
PubSub* = ref object of RootObj
|
||||
topics*: Table[string, seq[TopicHandler]]
|
||||
peers*: Table[PeerID, PubSubPeer]
|
||||
|
||||
proc getOrCreatePeer*(myParam: PubSub, peerId: PeerID, protos: seq[string]): PubSubPeer =
|
||||
myParam.peers.withValue(peerId, peer):
|
||||
return peer[]
|
||||
|
||||
method handleConn*(myParam: PubSub,
|
||||
conn: Connection,
|
||||
proto: string) {.base, async.} =
|
||||
myParam.peers.withValue(conn.peerInfo.peerId, peer):
|
||||
let peerB = peer[]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue