fix sctp wrong addr call & remove gcsafe

This commit is contained in:
Ludovic Chenut 2024-03-07 17:18:49 +01:00
parent 56ca60c534
commit 0521012ffc
No known key found for this signature in database
GPG Key ID: D9A59B1907F1D50C
2 changed files with 3 additions and 3 deletions

View File

@ -284,7 +284,7 @@ proc removeConnection(self: Dtls, conn: DtlsConn, raddr: TransportAddress) {.asy
await conn.join() await conn.join()
self.connections.del(raddr) self.connections.del(raddr)
proc accept*(self: Dtls): Future[DtlsConn] {.async, gcsafe.} = proc accept*(self: Dtls): Future[DtlsConn] {.async.} =
var var
selfvar = self selfvar = self
res = DtlsConn() res = DtlsConn()
@ -333,7 +333,7 @@ proc accept*(self: Dtls): Future[DtlsConn] {.async, gcsafe.} =
continue continue
return res return res
proc connect*(self: Dtls, raddr: TransportAddress): Future[DtlsConn] {.async, gcsafe.} = proc connect*(self: Dtls, raddr: TransportAddress): Future[DtlsConn] {.async.} =
var var
selfvar = self selfvar = self
res = DtlsConn() res = DtlsConn()

View File

@ -159,7 +159,7 @@ proc write*(self: SctpConn, buf: seq[byte],
self.sctpSocket.usrsctp_sendv(cast[pointer](addr cpy[0]), cpy.len().uint, nil, 0, self.sctpSocket.usrsctp_sendv(cast[pointer](addr cpy[0]), cpy.len().uint, nil, 0,
nil, 0, SCTP_SENDV_NOINFO.cuint, 0) nil, 0, SCTP_SENDV_NOINFO.cuint, 0)
else: else:
let sendInfo = sctp_sndinfo( var sendInfo = sctp_sndinfo(
snd_sid: sendParams.streamId, snd_sid: sendParams.streamId,
# TODO: swapBytes => htonl? # TODO: swapBytes => htonl?
snd_ppid: sendParams.protocolId.swapBytes(), snd_ppid: sendParams.protocolId.swapBytes(),