Commit 289d21a5 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

winhttp: Do not reference request from socket.

parent 50bea867
......@@ -3191,7 +3191,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 );
......@@ -3286,9 +3285,6 @@ HINTERNET WINAPI WinHttpWebSocketCompleteUpgrade( HINTERNET hrequest, DWORD_PTR
netconn_addref( request->netconn );
socket->netconn = request->netconn;
addref_object( &request->hdr );
socket->request = request;
netconn_set_timeout( socket->netconn, FALSE, socket->keepalive_interval );
if ((hsocket = alloc_handle( &socket->hdr )))
......
......@@ -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__ );
......
......@@ -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;
......
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