Check for errors after sendPendingSslData (#16696)
* Check for errors after sendPendingSslData * Leftover comment removed
This commit is contained in:
parent
b727217229
commit
165d39738d
1 changed files with 2 additions and 6 deletions
|
|
@ -259,11 +259,9 @@ when defineSsl:
|
||||||
ErrClearError()
|
ErrClearError()
|
||||||
# Call the desired operation.
|
# Call the desired operation.
|
||||||
opResult = op
|
opResult = op
|
||||||
# Bit hackish here.
|
|
||||||
# TODO: Introduce an async template transformation pragma?
|
|
||||||
|
|
||||||
# Send any remaining pending SSL data.
|
# Send any remaining pending SSL data.
|
||||||
yield sendPendingSslData(socket, flags)
|
await sendPendingSslData(socket, flags)
|
||||||
|
|
||||||
# If the operation failed, try to see if SSL has some data to read
|
# If the operation failed, try to see if SSL has some data to read
|
||||||
# or write.
|
# or write.
|
||||||
|
|
@ -321,10 +319,8 @@ template readInto(buf: pointer, size: int, socket: AsyncSocket,
|
||||||
sslRead(socket.sslHandle, cast[cstring](buf), size.cint))
|
sslRead(socket.sslHandle, cast[cstring](buf), size.cint))
|
||||||
res = opResult
|
res = opResult
|
||||||
else:
|
else:
|
||||||
var recvIntoFut = asyncdispatch.recvInto(socket.fd.AsyncFD, buf, size, flags)
|
|
||||||
yield recvIntoFut
|
|
||||||
# Not in SSL mode.
|
# Not in SSL mode.
|
||||||
res = recvIntoFut.read()
|
res = await asyncdispatch.recvInto(socket.fd.AsyncFD, buf, size, flags)
|
||||||
res
|
res
|
||||||
|
|
||||||
template readIntoBuf(socket: AsyncSocket,
|
template readIntoBuf(socket: AsyncSocket,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue