Commit 05cf71be authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

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

parent 0875bf89
......@@ -319,7 +319,7 @@ static void test_SendRequest (void)
static CHAR post_data[] = "mode=Test";
static const char test_post[] = "mode => Test\0\n";
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;
BOOL ret;
CHAR buffer[256];
......@@ -350,6 +350,12 @@ static void test_SendRequest (void)
ret = WinHttpSetOption(request, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(context));
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++;
ret = WinHttpSendRequest(request, content_type, header_len, post_data, optional_len, total_len, context);
err = GetLastError();
......
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