[Bug 59573] New: Regression introduced by decompression support in winhttp
http://bugs.winehq.org/show_bug.cgi?id=59573 Bug ID: 59573 Summary: Regression introduced by decompression support in winhttp Product: Wine Version: 11.5 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winhttp Assignee: wine-bugs@list.winehq.org Reporter: sutupud@yahoo.com Distribution: --- Initial problem was voice chat being broken in Overwatch, trying to connect resulted in an error message. I bisected it to 335ae4237c72f09408e9b1b26b1d5f3891ed9a3c On looking more closely through the output of WINEDEBUG=+winhttp, the server response has a "Content-Encoding: utf-8" header. That triggers this branch here: https://gitlab.winehq.org/wine/wine/-/commit/335ae4237c72f09408e9b1b26b1d5f3... The query here checks for the wrong header, it should be for WINHTTP_QUERY_CONTENT_TRANSFER_ENCODING, not for WINHTTP_QUERY_CONTENT_ENCODING! Changing it to that fixes the problem. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59573 mata <sutupud@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |335ae4237c72f09408e9b1b26b1 | |d5f3891ed9a3c -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59573 mata <sutupud@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59573 --- Comment #1 from mata <sutupud@yahoo.com> --- Might also be the same cause as for https://bugs.winehq.org/show_bug.cgi?id=59558 But https://bugs.winehq.org/show_bug.cgi?id=59546 is unrelated, the patch mentioned there has no influence on this. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59573 --- Comment #2 from mata <sutupud@yahoo.com> --- Actually, testing some more, it seems that the right header returned for compressed content is for example Content-Encoding: deflate But in this case, there wasn't even a copression related 'Accept: ' header set in the first place. In the absence of that, assuming it has to be one of gzip or deflate and otherwise setting else ret = ERROR_WINHTTP_INVALID_SERVER_RESPONSE; seems wrong to me. I'll also attach the logs I creatd from Overwatch. I used a simple script for some tests following some microsoft examples: function testReq(url) { try { WScript.Echo("--- trying: " + url + " ---") var req = new ActiveXObject("WinHttp.WinHttpRequest.5.1"); req.Open("GET", url , true); req.Send(); req.WaitForResponse(); WScript.Echo("--- headers ---") WScript.Echo(req.GetAllResponseHeaders()) WScript.Echo("--- response text ---") WScript.Echo(req.ResponseText) WScript.Echo("--- response body ---") WScript.Echo(req.ResponseBody) } catch (err) { WScript.Echo(err + " - " + (err.number & 0xFFFF).toString()) } } testReq("https://httpbin.org/deflate") testReq("https://httpbin.org/gzip") That works with the original WINHTTP_QUERY_CONTENT_ENCODING. gzip works, but the `deflate` case doesn't work unless i change inflateInit2() window size argument from -15 to 15. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59573 --- Comment #3 from mata <sutupud@yahoo.com> --- Created attachment 80630 --> http://bugs.winehq.org/attachment.cgi?id=80630 logs from overwatch -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59573 Austin English <austinenglish@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish@gmail.com, | |hans@meelstraat.net -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59573 --- Comment #4 from Hans Leidekker <hans@meelstraat.net> --- Created attachment 80631 --> http://bugs.winehq.org/attachment.cgi?id=80631 patch Thanks, here's a patch against current git wine that should fix this. The value 'utf-8' isn't actually valid for the Content-Encoding header (this server lives up to its name: TwistedWeb/12.2.0) but Windows accepts this and so should we. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59573 --- Comment #5 from mata <sutupud@yahoo.com> --- (In reply to Hans Leidekker from comment #4)
Created attachment 80631 [details] patch
Thanks, here's a patch against current git wine that should fix this. The value 'utf-8' isn't actually valid for the Content-Encoding header (this server lives up to its name: TwistedWeb/12.2.0) but Windows accepts this and so should we.
Yes, thank you, the changes from that patch fix the issue. I guess validity would he hard to enforce for those headers, reading through rfc9110 they only "ought" to be registered with IANA, which in RFC terms is pretty weak language. And with registration would also be subject to change. Also, if the application wants to make use of a coding not supported by the transport layer (e.g. brotli or zstd), there's not really anything hindering it to set the "Accept-Encoding" header explicitly and then decompress it internally... -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59573 --- Comment #6 from Hans Leidekker <hans@meelstraat.net> --- (In reply to mata from comment #5)
(In reply to Hans Leidekker from comment #4)
Created attachment 80631 [details] patch
Thanks, here's a patch against current git wine that should fix this. The value 'utf-8' isn't actually valid for the Content-Encoding header (this server lives up to its name: TwistedWeb/12.2.0) but Windows accepts this and so should we.
Yes, thank you, the changes from that patch fix the issue.
Thanks for testing.
I guess validity would he hard to enforce for those headers, reading through rfc9110 they only "ought" to be registered with IANA, which in RFC terms is pretty weak language. And with registration would also be subject to change. Also, if the application wants to make use of a coding not supported by the transport layer (e.g. brotli or zstd), there's not really anything hindering it to set the "Accept-Encoding" header explicitly and then decompress it internally...
True, my worry was that the app could enable WINHTTP_OPTION_DECOMPRESSION (which triggers winhttp to add an Accept-Encoding header with value gzip,deflate) and then rightfully expect winhttp to decompress the stream. If the server responds with a Content-Encoding header that doesn't specify one of the accepted encodings I would say that's an invalid response. But this will needs some tests to determine what Windows does in this case. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59573 Hans Leidekker <hans@meelstraat.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |d1e37f3923367c17d7732ce3e64 | |21950b977858c Status|UNCONFIRMED |RESOLVED --- Comment #7 from Hans Leidekker <hans@meelstraat.net> --- Fixed with d1e37f3923367c17d7732ce3e6421950b977858c. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59573 Alexandre Julliard <julliard@winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #8 from Alexandre Julliard <julliard@winehq.org> --- Closing bugs fixed in 11.6. -- 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.
participants (1)
-
WineHQ Bugzilla