Commit 0417d9d0 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

winhttp: Set socket close state in WinHttpWebSocketClose().

parent 57b26a83
...@@ -3784,7 +3784,6 @@ static DWORD socket_close( struct socket *socket ) ...@@ -3784,7 +3784,6 @@ static DWORD socket_close( struct socket *socket )
if ((ret = socket_drain( socket ))) return ret; if ((ret = socket_drain( socket ))) return ret;
} }
socket->state = SOCKET_STATE_CLOSED;
return receive_close_status( socket, count ); return receive_close_status( socket, count );
} }
...@@ -3834,6 +3833,7 @@ DWORD WINAPI WinHttpWebSocketClose( HINTERNET hsocket, USHORT status, void *reas ...@@ -3834,6 +3833,7 @@ DWORD WINAPI WinHttpWebSocketClose( HINTERNET hsocket, USHORT status, void *reas
if (socket->state < SOCKET_STATE_SHUTDOWN if (socket->state < SOCKET_STATE_SHUTDOWN
&& (ret = send_socket_shutdown( socket, status, reason, len, FALSE ))) goto done; && (ret = send_socket_shutdown( socket, status, reason, len, FALSE ))) goto done;
socket->state = SOCKET_STATE_CLOSED;
if (socket->request->connect->hdr.flags & WINHTTP_FLAG_ASYNC) if (socket->request->connect->hdr.flags & WINHTTP_FLAG_ASYNC)
{ {
struct socket_shutdown *s; struct socket_shutdown *s;
......
...@@ -955,18 +955,18 @@ static void test_websocket(BOOL secure) ...@@ -955,18 +955,18 @@ static void test_websocket(BOOL secure)
close_status = 0xdead; close_status = 0xdead;
size = sizeof(buffer) + 1; size = sizeof(buffer) + 1;
err = pWinHttpWebSocketQueryCloseStatus( socket, &close_status, buffer, sizeof(buffer), &size ); err = pWinHttpWebSocketQueryCloseStatus( socket, &close_status, buffer, sizeof(buffer), &size );
ok( err == ERROR_INVALID_OPERATION, "got %u\n", err ); todo_wine ok( err == ERROR_INVALID_OPERATION, "got %u\n", err );
ok( close_status == 0xdead, "got %u\n", close_status ); todo_wine ok( close_status == 0xdead, "got %u\n", close_status );
ok( size == sizeof(buffer) + 1, "got %u\n", size ); todo_wine ok( size == sizeof(buffer) + 1, "got %u\n", size );
WaitForSingleObject( info.wait, INFINITE ); WaitForSingleObject( info.wait, INFINITE );
close_status = 0xdead; close_status = 0xdead;
size = sizeof(buffer) + 1; size = sizeof(buffer) + 1;
err = pWinHttpWebSocketQueryCloseStatus( socket, &close_status, buffer, sizeof(buffer), &size ); err = pWinHttpWebSocketQueryCloseStatus( socket, &close_status, buffer, sizeof(buffer), &size );
todo_wine ok( err == ERROR_SUCCESS, "got %u\n", err ); ok( err == ERROR_SUCCESS, "got %u\n", err );
todo_wine ok( close_status == 1000, "got %u\n", close_status ); ok( close_status == 1000, "got %u\n", close_status );
todo_wine ok( size <= sizeof(buffer), "got %u\n", size ); ok( size <= sizeof(buffer), "got %u\n", size );
setup_test( &info, winhttp_close_handle, __LINE__ ); setup_test( &info, winhttp_close_handle, __LINE__ );
......
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