Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.5.0
-
None
Description
Since Qt6.5 (well, after 6.2.4), calling canreadline on a QNetworkReply returns false before reading. This code prints false and true.
QNetworkRequest request( QUrl( "https://www.test.com" ) ) ; QNetworkAccessManager networkAccessManager ; auto reply = networkAccessManager.get( request ) ; QObject::connect( reply, &QIODevice::readyRead, [reply]() { qDebug() << reply->canReadLine() ; reply->peek( 1 ) ; qDebug() << reply->canReadLine() ; } ) ;
Seems to be related to :
- https://bugreports.qt.io/browse/QTBUG-83269
- https://code.qt.io/cgit/qt/qtbase.git/commit/src/network/access/qnetworkreplyhttpimpl.cpp?id=6f25051536c1636688a0a0939196007aac34676d
Peeking one character is a workaround, but I think data should be decompressed before any call to canreadline.