Hans Leidekker : winhttp/tests: Fix an intermittent test failure on Windows XP/Vista.
Alexandre Julliard
julliard at winehq.org
Fri Dec 22 11:15:05 CST 2017
Module: wine
Branch: master
Commit: 05cf71be99bcb02a1cdaeb779a1fc4e1a349c0b9
URL: https://source.winehq.org/git/wine.git/?a=commit;h=05cf71be99bcb02a1cdaeb779a1fc4e1a349c0b9
Author: Hans Leidekker <hans at codeweavers.com>
Date: Fri Dec 22 16:52:51 2017 +0100
winhttp/tests: Fix an intermittent test failure on Windows XP/Vista.
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winhttp/tests/winhttp.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c
index ec33b56..4fc9c2c 100644
--- a/dlls/winhttp/tests/winhttp.c
+++ b/dlls/winhttp/tests/winhttp.c
@@ -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();
More information about the wine-cvs
mailing list