Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.3.0
-
None
-
Currently working with gcc (GCC) 12.1.0. We did not test other versions yet.
-
-
e3ea1d02e6 (qt/qtbase/dev) e3ea1d02e6 (qt/tqtc-qtbase/dev) 20b3d55090 (qt/qtbase/6.3) 20b3d55090 (qt/tqtc-qtbase/6.3) 9d70596799 (qt/qtbase/6.4) 9d70596799 (qt/tqtc-qtbase/6.4)
Description
With Qt 6.2.4 all is working fine but with Qt 6.3.0 we ran into a problem where a HTTP-Redirect (ManualRedirectPolicy) is no longer working. We are using exactly the same environment for both builds.
The Problem seems to be in `QHttpNetworkReplyPrivate::expectContent()`. `Content-Length: 0` is contained in the redirect. But since Qt 6.3.0 the compiler decides to optimize the code and `expectedContentLength` is no longer available when the check is done. But after the check it becomes -1. But because bodyLength is -1 the next check also not succeeds and the function returns true at the end. Maybe the screenshots I appended make the situation more clear.
We still try to solve the problem, but maybe anyone can help us. Sadly we are not able to provide a minimal example yet. With the attached test we can not reproduce the issue. Using the debugger in attached tests shows the same behavior. `QHttpNetworkReplyPrivate::expectContent()` returns true. But there seems to be an additional call of `QHttpProtocolHandler::_q_receiveReply()` where we ran into an early return that leads to the finished signal:
// finish this reply. this case happens when the server did not send a content length m_reply->d_func()->state = QHttpNetworkReplyPrivate::AllDoneState; m_channel->allDone(); return;
But this is obviously wrong because there is a conent length.