winhttp/tests: Fix an intermittent test failure on Windows XP/Vista.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2017-12-22 16:52:51 +01:00 committed by Alexandre Julliard
parent 0875bf8974
commit 05cf71be99
1 changed files with 7 additions and 1 deletions

View File

@ -319,7 +319,7 @@ static void test_SendRequest (void)
static CHAR post_data[] = "mode=Test"; static CHAR post_data[] = "mode=Test";
static const char test_post[] = "mode => Test\0\n"; static const char test_post[] = "mode => Test\0\n";
HINTERNET session, request, connection; HINTERNET session, request, connection;
DWORD header_len, optional_len, total_len, bytes_rw, size, err; DWORD header_len, optional_len, total_len, bytes_rw, size, err, disable;
DWORD_PTR context; DWORD_PTR context;
BOOL ret; BOOL ret;
CHAR buffer[256]; CHAR buffer[256];
@ -350,6 +350,12 @@ static void test_SendRequest (void)
ret = WinHttpSetOption(request, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(context)); ret = WinHttpSetOption(request, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(context));
ok(ret, "WinHttpSetOption failed: %u\n", GetLastError()); ok(ret, "WinHttpSetOption failed: %u\n", GetLastError());
/* writing more data than promised by the content-length header causes an error when the connection
is resued, so disable keep-alive */
disable = WINHTTP_DISABLE_KEEP_ALIVE;
ret = WinHttpSetOption(request, WINHTTP_OPTION_DISABLE_FEATURE, &disable, sizeof(disable));
ok(ret, "WinHttpSetOption failed: %u\n", GetLastError());
context++; context++;
ret = WinHttpSendRequest(request, content_type, header_len, post_data, optional_len, total_len, context); ret = WinHttpSendRequest(request, content_type, header_len, post_data, optional_len, total_len, context);
err = GetLastError(); err = GetLastError();