diff options
author | narimiran <narimiran@disroot.org> | 2020-07-06 11:24:43 +0200 |
---|---|---|
committer | narimiran <narimiran@disroot.org> | 2020-07-06 11:24:43 +0200 |
commit | 46aacf917f39d02c96175d358e7a76fc875ea070 (patch) | |
tree | 6f9595ae320659f6969f6cc743d2e39041aeca22 /lib/pure/asyncnet.nim | |
parent | ebaf603c84a569b8de447fdb66bb05124d3a0772 (diff) | |
download | Nim-46aacf917f39d02c96175d358e7a76fc875ea070.tar.gz |
Fix style inconsistencies due to the previous commit
Diffstat (limited to 'lib/pure/asyncnet.nim')
-rw-r--r-- | lib/pure/asyncnet.nim | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/pure/asyncnet.nim b/lib/pure/asyncnet.nim index 0bdbeb29b..410310e29 100644 --- a/lib/pure/asyncnet.nim +++ b/lib/pure/asyncnet.nim @@ -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, |