From: Paul Gofman pgofman@codeweavers.com
--- dlls/winhttp/request.c | 4 ---- dlls/winhttp/tests/notification.c | 8 +++++--- dlls/winhttp/winhttp_private.h | 1 - 3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index a3420507da7..15123d8bff1 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -3185,7 +3185,6 @@ static void socket_destroy( struct object_header *hdr ) stop_queue( &socket->recv_q );
netconn_release( socket->netconn ); - release_object( &socket->request->hdr ); free( socket->read_buffer ); free( socket->send_frame_buffer ); free( socket ); @@ -3275,9 +3274,6 @@ HINTERNET WINAPI WinHttpWebSocketCompleteUpgrade( HINTERNET hrequest, DWORD_PTR request->read_pos = request->read_size = 0; }
- addref_object( &request->hdr ); - socket->request = request; - netconn_set_timeout( socket->netconn, FALSE, socket->keepalive_interval );
if ((hsocket = alloc_handle( &socket->hdr ))) diff --git a/dlls/winhttp/tests/notification.c b/dlls/winhttp/tests/notification.c index 181bd35856b..a9f782f5e3d 100644 --- a/dlls/winhttp/tests/notification.c +++ b/dlls/winhttp/tests/notification.c @@ -671,7 +671,8 @@ static const struct notification websocket_test[] = { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE, NF_SIGNAL }, - { winhttp_websocket_complete_upgrade, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, NF_SIGNAL }, + { winhttp_websocket_complete_upgrade, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, + { winhttp_websocket_complete_upgrade, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL }, { winhttp_websocket_send, WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE, NF_MAIN_THREAD | NF_SIGNAL }, { winhttp_websocket_send, WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE, NF_MAIN_THREAD | NF_SIGNAL }, { winhttp_websocket_send, WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE, NF_MAIN_THREAD | NF_SIGNAL }, @@ -680,7 +681,6 @@ static const struct notification websocket_test[] = { winhttp_websocket_receive, WINHTTP_CALLBACK_STATUS_READ_COMPLETE, NF_SAVE_BUFFER | NF_SIGNAL }, { winhttp_websocket_receive, WINHTTP_CALLBACK_STATUS_READ_COMPLETE, NF_SAVE_BUFFER | NF_SIGNAL }, { winhttp_websocket_close, WINHTTP_CALLBACK_STATUS_CLOSE_COMPLETE, NF_SIGNAL }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL }, };
@@ -911,6 +911,9 @@ static void test_websocket(BOOL secure) err = GetLastError(); ok( socket != NULL, "got %lu\n", err ); ok( err == ERROR_SUCCESS, "got %lu\n", err ); + + WinHttpCloseHandle( request ); + WaitForSingleObject( info.wait, INFINITE );
/* The send is executed synchronously (even if sending a reasonably big buffer exceeding SSL buffer size). @@ -1029,7 +1032,6 @@ static void test_websocket(BOOL secure)
setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( socket ); - WinHttpCloseHandle( request );
WaitForSingleObject( info.wait, INFINITE ); end_test( &info, __LINE__ ); diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index 5885f46058d..4e9c14a2ed7 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -256,7 +256,6 @@ enum fragment_type struct socket { struct object_header hdr; - struct request *request; struct netconn *netconn; int keepalive_interval; unsigned int send_buffer_size;