Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46175 Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/winhttp/request.c | 6 ++++++ dlls/winhttp/tests/winhttp.c | 5 +++++ 2 files changed, 11 insertions(+)
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 54173f1ff4..27628c3292 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -2736,6 +2736,12 @@ static BOOL receive_response( struct request *request, BOOL async ) BOOL ret; DWORD size, query, status;
+ if (!request->netconn) + { + SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_STATE ); + return FALSE; + } + netconn_set_timeout( request->netconn, FALSE, request->receive_response_timeout ); for (;;) { diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 4779cfd1a7..3f9125154f 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -2086,6 +2086,11 @@ static void test_resolve_timeout(void) ok(GetLastError() == ERROR_WINHTTP_NAME_NOT_RESOLVED, "expected ERROR_WINHTTP_NAME_NOT_RESOLVED got %u\n", GetLastError());
+ ret = WinHttpReceiveResponse( req, NULL ); + ok( !ret && (GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_STATE || + GetLastError() == ERROR_WINHTTP_OPERATION_CANCELLED /* < win7 */), + "got %u\n", GetLastError() ); + WinHttpCloseHandle(req); WinHttpCloseHandle(con); WinHttpCloseHandle(ses);
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=44828
Your paranoid android.
=== wvistau64_zh_CN (32 bit report) ===
winhttp: winhttp.c:2446: Test failed: failed to receive response 12152 winhttp.c:2451: Test failed: failed to query status code 12019 winhttp.c:2452: Test failed: request failed unexpectedly 3735928559 winhttp.c:2467: Test failed: failed to query for raw headers: 12019 winhttp.c:2468: Test failed: WinHttpQueryHeaders returned invalid end of header string winhttp.c:2474: Test failed: failed to query for raw headers: 12019 winhttp.c:2475: Test failed: WinHttpQueryHeaders returned invalid end of header string winhttp.c:2477: Test failed: returned string has too many NULL characters winhttp.c:2482: Test failed: failed to read data 12019 winhttp.c:2483: Test failed: count was wrong winhttp.c:2484: Test failed: http data wrong