Search code examples
c++qtqnetworkreplyqnetworkrequest

QNetworkReply error: Network access is disabled


I am using QNetworkRequest/QNetworkReply to download a file. On an older program version which was used by thousands of people it worked flawlessly (VS 2010 compiler). After upgrading to Visual Studio 2015 and recompiling the whole project with XP target (the same procedure with OpenSSL) a few users started getting an error when the download is initiated:

Network access is disabled.

The error is logged in a slot that is connected to error() signal from QNetworkReply::NetworkError.

Code:

QNetworkReply reply = nam.get(QNetworkRequest(url));
emit sendInfo("Starting download");
QObject::connect(reply, SIGNAL(finished()), this, SLOT(finishedSlot()));
QObject::connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(errorSlot(QNetworkReply::NetworkError)));
QObject::connect(reply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(progressSlot(qint64, qint64)));

I managed to install Wireshark on one of the affected machines but no requests are made to the internet so it is failing from the very beginning. So far I was not able to find out what causes the problem on these machines. OS version does not matter, tried disabling AV/firewall etc. I am also unable to find any details of the error string that is returned.

The code works fine for 90% of the people and was tested from XP SP3 up to Windows 10.

What could be a problem and how do I even approach to debug this?


Solution

  • Apparently a bug in Qt 5.5.1 https://github.com/owncloud/client/issues/3600 although I can't confirm this with 100% certainty.