Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct 2 small bugs #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .qmake.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
load(qt_build_config)

MODULE_VERSION = 5.12.0
MODULE_VERSION = 5.15.2
2 changes: 1 addition & 1 deletion src/httpserver/qabstracthttpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void QAbstractHttpServerPrivate::handleReadyRead(QTcpSocket *socket,
request->d->clear();

if (!request->d->parse(socket)) {
socket->disconnect();
socket->disconnectFromHost();
return;
}

Expand Down
13 changes: 9 additions & 4 deletions tests/auto/qhttpserver/tst_qhttpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,18 @@ void tst_QHttpServer::initTestCase()
[expectedSslErrors](QNetworkReply *reply,
const QList<QSslError> &errors) {
for (const auto &error: errors) {
bool expected{false};
for (const auto &expectedError: expectedSslErrors) {
if (error.error() != expectedError.error() ||
error.certificate() != expectedError.certificate()) {
qCritical() << "Got unexpected ssl error:"
<< error << error.certificate();
if (error.error() == expectedError.error() ||
error.certificate() == expectedError.certificate()) {
expected = true;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I happened to come across this pull request, and I wondered if the or in the logic should be changed into an and, since we're inverting the logic in the original code. Both there error type and the associated error certificate in the expected should match the actual error.

}
}
if(!expected)
{
qCritical() << "Got unexpected ssl error:"
<< error << error.certificate();
}
}
reply->ignoreSslErrors(expectedSslErrors);
});
Expand Down