Fix style inconsistencies due to the previous commit
This commit is contained in:
parent
ebaf603c84
commit
46aacf917f
10 changed files with 85 additions and 85 deletions
|
|
@ -202,7 +202,7 @@ proc newAsyncSocket*(domain, sockType, protocol: cint,
|
|||
when defineSsl:
|
||||
proc getSslError(handle: SslPtr, err: cint): cint =
|
||||
assert err < 0
|
||||
var ret = SSLGetError(handle, err.cint)
|
||||
var ret = SSL_get_error(handle, err.cint)
|
||||
case ret
|
||||
of SSL_ERROR_ZERO_RETURN:
|
||||
raiseSSLError("TLS/SSL connection failed to initiate, socket closed prematurely.")
|
||||
|
|
@ -224,9 +224,9 @@ when defineSsl:
|
|||
let read = bioRead(socket.bioOut, addr data[0], len)
|
||||
assert read != 0
|
||||
if read < 0:
|
||||
raiseSslError()
|
||||
raiseSSLError()
|
||||
data.setLen(read)
|
||||
await socket.fd.AsyncFd.send(data, flags)
|
||||
await socket.fd.AsyncFD.send(data, flags)
|
||||
|
||||
proc appeaseSsl(socket: AsyncSocket, flags: set[SocketFlag],
|
||||
sslError: cint): owned(Future[bool]) {.async.} =
|
||||
|
|
@ -727,7 +727,7 @@ proc close*(socket: AsyncSocket) =
|
|||
if res == 0:
|
||||
discard
|
||||
elif res != 1:
|
||||
raiseSslError()
|
||||
raiseSSLError()
|
||||
socket.closed = true # TODO: Add extra debugging checks for this.
|
||||
|
||||
when defineSsl:
|
||||
|
|
@ -739,12 +739,12 @@ when defineSsl:
|
|||
## prone to security vulnerabilities.
|
||||
socket.isSsl = true
|
||||
socket.sslContext = ctx
|
||||
socket.sslHandle = SSLNew(socket.sslContext.context)
|
||||
socket.sslHandle = SSL_new(socket.sslContext.context)
|
||||
if socket.sslHandle == nil:
|
||||
raiseSslError()
|
||||
raiseSSLError()
|
||||
|
||||
socket.bioIn = bioNew(bio_s_mem())
|
||||
socket.bioOut = bioNew(bio_s_mem())
|
||||
socket.bioIn = bioNew(bioSMem())
|
||||
socket.bioOut = bioNew(bioSMem())
|
||||
sslSetBio(socket.sslHandle, socket.bioIn, socket.bioOut)
|
||||
|
||||
proc wrapConnectedSocket*(ctx: SslContext, socket: AsyncSocket,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue