diff --git a/src/SSLSocket.c b/src/SSLSocket.c index 1ca2c48d..fd80c727 100644 --- a/src/SSLSocket.c +++ b/src/SSLSocket.c @@ -1102,4 +1102,15 @@ int SSLSocket_continueWrite(pending_writes* pw) FUNC_EXIT_RC(rc); return rc; } + + +int SSLSocket_abortWrite(pending_writes* pw) +{ + int rc = 0; + + FUNC_ENTRY; + free(pw->iovecs[0].iov_base); + FUNC_EXIT_RC(rc); + return rc; +} #endif diff --git a/src/SSLSocket.h b/src/SSLSocket.h index 7234b964..3fcf0c1d 100644 --- a/src/SSLSocket.h +++ b/src/SSLSocket.h @@ -48,5 +48,6 @@ int SSLSocket_connect(SSL* ssl, SOCKET sock, const char* hostname, int verify, i SOCKET SSLSocket_getPendingRead(void); int SSLSocket_continueWrite(pending_writes* pw); +int SSLSocket_abortWrite(pending_writes* pw); #endif diff --git a/src/Socket.c b/src/Socket.c index f51f7fba..bcff03d4 100644 --- a/src/Socket.c +++ b/src/Socket.c @@ -640,7 +640,7 @@ exit: /** * Indicate whether any data is pending outbound for a socket. - * @return boolean - true == data pending. + * @return boolean - true == no pending data. */ int Socket_noPendingWrites(SOCKET socket) { @@ -1258,7 +1258,10 @@ int Socket_abortWrite(SOCKET socket) #if defined(OPENSSL) if (pw->ssl) + { + rc = SSLSocket_abortWrite(pw); goto exit; + } #endif for (i = 0; i < pw->count; i++)