Commit c6097caf authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

wininet: Deal with reading over the end in NETCON_recv.

parent a298415b
...@@ -134,6 +134,7 @@ MAKE_FUNCPTR(SSL_shutdown); ...@@ -134,6 +134,7 @@ MAKE_FUNCPTR(SSL_shutdown);
MAKE_FUNCPTR(SSL_write); MAKE_FUNCPTR(SSL_write);
MAKE_FUNCPTR(SSL_read); MAKE_FUNCPTR(SSL_read);
MAKE_FUNCPTR(SSL_pending); MAKE_FUNCPTR(SSL_pending);
MAKE_FUNCPTR(SSL_get_error);
MAKE_FUNCPTR(SSL_get_ex_new_index); MAKE_FUNCPTR(SSL_get_ex_new_index);
MAKE_FUNCPTR(SSL_get_ex_data); MAKE_FUNCPTR(SSL_get_ex_data);
MAKE_FUNCPTR(SSL_set_ex_data); MAKE_FUNCPTR(SSL_set_ex_data);
...@@ -392,6 +393,7 @@ DWORD NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL) ...@@ -392,6 +393,7 @@ DWORD NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
DYNSSL(SSL_write); DYNSSL(SSL_write);
DYNSSL(SSL_read); DYNSSL(SSL_read);
DYNSSL(SSL_pending); DYNSSL(SSL_pending);
DYNSSL(SSL_get_error);
DYNSSL(SSL_get_ex_new_index); DYNSSL(SSL_get_ex_new_index);
DYNSSL(SSL_get_ex_data); DYNSSL(SSL_get_ex_data);
DYNSSL(SSL_set_ex_data); DYNSSL(SSL_set_ex_data);
...@@ -772,6 +774,12 @@ DWORD NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int ...@@ -772,6 +774,12 @@ DWORD NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int
{ {
#ifdef SONAME_LIBSSL #ifdef SONAME_LIBSSL
*recvd = pSSL_read(connection->ssl_s, buf, len); *recvd = pSSL_read(connection->ssl_s, buf, len);
/* Check if EOF was received */
if(!*recvd && (pSSL_get_error(connection->ssl_s, *recvd)==SSL_ERROR_ZERO_RETURN
|| pSSL_get_error(connection->ssl_s, *recvd)==SSL_ERROR_SYSCALL))
return ERROR_SUCCESS;
return *recvd > 0 ? ERROR_SUCCESS : ERROR_INTERNET_CONNECTION_ABORTED; return *recvd > 0 ? ERROR_SUCCESS : ERROR_INTERNET_CONNECTION_ABORTED;
#else #else
return ERROR_NOT_SUPPORTED; return ERROR_NOT_SUPPORTED;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment