KTcpSocket ::errorString () == "Unknown error" after KTcpSocket ::waitForBytesWritten sets KTcpSocket ::error. Reproducible: Always Steps to Reproduce: 0. Modify KTcpSocketTest::statesIana in the following way: oid KTcpSocketTest::statesIana() { //A connection to a real internet host KTcpSocket s (this); connect(& s, SIGNAL(hostFound()), this, SLOT(states_hostFound())); QCOMPARE(s .state(), KTcpSocket::UnconnectedState); s .connectToHost("www.iana.org", 80); QCOMPARE(s .state(), KTcpSocket::HostLookupState); s .write(HTTPREQUEST); QCOMPARE(s .state(), KTcpSocket::HostLookupState); s .waitForBytesWritten(2500); if (KTcpSocket ::UnknownError == s .error ()) { QCOMPARE(s .state(), KTcpSocket::ConnectedState); s .waitForReadyRead(2500); //I actually assume that the page delivered by www.iana.org will exist for years QVERIFY(s .bytesAvailable() > 200); s .write(HTTPREQUEST); s .waitForReadyRead(); s .close(); if (s .state() == KTcpSocket::ClosingState) s .waitForDisconnected(); } else { QCOMPARE (s .state (), KTcpSocket ::UnconnectedState); qDebug () << s .errorString (); } //What happens is that during waitForReadyRead() the write buffer is written out //completely so that the socket can shut down without having to wait for writeout. QCOMPARE(s .state(), KTcpSocket::UnconnectedState); } 1. /home/abuild/rpmbuild/BUILD/kdelibs-4.10.5/build/kdecore/tests/ktcpsockettest.shell Actual Results: 1. 44: QDEBUG : KTcpSocketTest::statesIana() "Unknown error" Expected Results: 1. 44: QDEBUG : KTcpSocketTest::statesIana() "Host www.iana.org not found"
Dear Bug Submitter, This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond. Thank you for helping us make KDE software even better for everyone!
Dear Bug Submitter, This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand. Thank you for helping us make KDE software even better for everyone!
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version? If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
This test has fortunately been skipped as ‘unreliable’: <URL: https://invent.kde.org/frameworks/kio/-/blob/master/autotests/ktcpsockettest.cpp#L199 > To tell you the truth, it is not unreliable, it is simply wrong: <URL: https://stackoverflow.com/a/42050137 >