Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/winhttp/request.c | 11 +++-------- dlls/winhttp/tests/notification.c | 5 +++++ 2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index fc2c06bd11f..d9c5174f152 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -3652,14 +3652,7 @@ DWORD WINAPI WinHttpWebSocketReceive( HINTERNET hsocket, void *buf, DWORD len, D
static DWORD socket_shutdown( struct socket *socket, USHORT status, const void *reason, DWORD len ) { - DWORD ret; - - stop_queue( &socket->send_q ); - if (!(ret = send_frame( socket, SOCKET_OPCODE_CLOSE, status, reason, len, TRUE, NULL ))) - { - socket->state = SOCKET_STATE_SHUTDOWN; - } - return ret; + return send_frame( socket, SOCKET_OPCODE_CLOSE, status, reason, len, TRUE, NULL ); }
static void CALLBACK task_socket_shutdown( TP_CALLBACK_INSTANCE *instance, void *ctx, TP_WORK *work ) @@ -3707,6 +3700,8 @@ DWORD WINAPI WinHttpWebSocketShutdown( HINTERNET hsocket, USHORT status, void *r return ERROR_INVALID_OPERATION; }
+ socket->state = SOCKET_STATE_SHUTDOWN; + if (socket->request->connect->hdr.flags & WINHTTP_FLAG_ASYNC) { struct socket_shutdown *s; diff --git a/dlls/winhttp/tests/notification.c b/dlls/winhttp/tests/notification.c index 0c3ff98c342..4127f9933bb 100644 --- a/dlls/winhttp/tests/notification.c +++ b/dlls/winhttp/tests/notification.c @@ -814,6 +814,11 @@ static void test_websocket(BOOL secure) setup_test( &info, winhttp_websocket_shutdown, __LINE__ ); err = pWinHttpWebSocketShutdown( socket, 1000, (void *)"success", sizeof("success") ); ok( err == ERROR_SUCCESS, "got %u\n", err ); + + err = pWinHttpWebSocketSend( socket, WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE, + (void*)"hello", sizeof("hello") ); + ok( err == ERROR_INVALID_OPERATION, "got %u\n", err ); + WaitForSingleObject( info.wait, INFINITE );
err = pWinHttpWebSocketShutdown( socket, 1000, (void *)"success", sizeof("success") );