[Bug 37023] winhttp: HEAD-requests are not handled correctly

wine-bugs at winehq.org wine-bugs at winehq.org
Thu Nov 13 09:11:57 CST 2014


https://bugs.winehq.org/show_bug.cgi?id=37023

--- Comment #3 from Sebastian Lackner <sebastian at fds-team.de> ---
I don't see a big problem with timing based tests (especially when you send
first the patch to fix it), but you should probably use something a bit more
easy like GetTickCount(). Moreover, the timeout shouldn't be too high since
this is only a localhost connection, and never expected to take several
seconds.

I am not sure about the fix, a better method would be to set
request->content_length to zero when no answer is expected, like:

--- snip ---
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index d497d7a..c07e663 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -1806,2 +1806,3 @@ static DWORD set_content_length( request_t *request )
 {
+    static const WCHAR headW[] = {'H','E','A','D',0};
     WCHAR encoding[20];
@@ -1823,2 +1824,10 @@ static DWORD set_content_length( request_t *request )
     }
+
+    /* For a HEAD request we never expect any content */
+    if (request->verb && !strcmpiW(request->verb, headW))
+    {
+        request->content_length = 0;
+        request->read_chunked = FALSE;
+    }
+
     request->content_read = 0;
--- snip ---

The main issue I see is that the tests do not even work on Windows:
http://newtestbot.winehq.org/JobDetails.pl?Key=10229

Does this make the bug invalid, or does your testcase just not properly
reproduce the issue?

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list