fix sctp wrong addr call & remove gcsafe
This commit is contained in:
parent
56ca60c534
commit
0521012ffc
|
@ -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()
|
||||||
|
|
|
@ -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(),
|
||||||
|
|
Loading…
Reference in New Issue