Created
January 25, 2022 18:13
-
-
Save gofman/bd2f3b6fd6cbe993e97353560ce81e04 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 335a39e45cd51b47a67f55202842667b8de81a9f Mon Sep 17 00:00:00 2001 | |
From: Paul Gofman <pgofman@codeweavers.com> | |
Date: Tue, 25 Jan 2022 21:07:46 +0300 | |
Subject: [PATCH] winhttp/tests: Test websocket receive timeout. | |
--- | |
dlls/winhttp/tests/notification.c | 8 +++++++- | |
1 file changed, 7 insertions(+), 1 deletion(-) | |
diff --git a/dlls/winhttp/tests/notification.c b/dlls/winhttp/tests/notification.c | |
index bdb2fd635f9..434041345cd 100644 | |
--- a/dlls/winhttp/tests/notification.c | |
+++ b/dlls/winhttp/tests/notification.c | |
@@ -743,7 +743,7 @@ static void test_websocket(BOOL secure) | |
struct info info, *context = &info; | |
char buffer[8192 * 2]; | |
USHORT close_status; | |
- DWORD protocols, flags; | |
+ DWORD protocols, flags, value; | |
unsigned int i; | |
if (!pWinHttpWebSocketCompleteUpgrade) | |
@@ -786,6 +786,10 @@ static void test_websocket(BOOL secure) | |
ok( ret, "got %u\n", err ); | |
ok( err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err); | |
+ value = 1000; | |
+ ret = WinHttpSetOption(session, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, sizeof(value)); | |
+ ok(ret, "%u\n", GetLastError()); | |
+ | |
setup_test( &info, winhttp_connect, __LINE__ ); | |
SetLastError( 0xdeadbeef ); | |
connection = WinHttpConnect( session, L"ws.ifelse.io", 0, 0 ); | |
@@ -985,6 +989,8 @@ static void test_websocket(BOOL secure) | |
err = pWinHttpWebSocketReceive( socket, buffer, sizeof(buffer), &size, &type ); | |
ok( err == ERROR_SUCCESS, "got %u\n", err ); | |
+ Sleep(3000); | |
+ | |
setup_test( &info, winhttp_websocket_close, __LINE__ ); | |
ret = pWinHttpWebSocketClose( socket, 1000, (void *)"success", sizeof("success") ); | |
ok( err == ERROR_SUCCESS, "got %u\n", err ); | |
-- | |
2.34.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment