readChannelFinished() emitted twice if request has Content-Length header
Closed this issue · 0 comments
nathan-osman commented
The QHttpEngine::Socket::readChannelFinished()
signal is emitted twice if the following occurs:
-
The
Content-Length
header is set on the request, causing the signal to be emitted whenrequestDataRead
is equal or greater thanrequestDataTotal
(see here) -
The physical transport (
QTcpSocket
) emits thereadChannelFinished()
signal, which is connected toQHttpEngine::Socket::readChannelFinished()
, causing it to be emitted a second time (see here)
The correct behavior would be for the transport signal to be connected to a private slot that emits QHttpEngine::Socket::readChannelFinished()
only if requestDataTotal
is equal to -1.