2
votes

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?

1
Do those bad machines have any firewalls? Try to send GET request to any public site like google.com on standard port 80. Does it work? - hank
You said "old program version ... 2010 compiler". That sounds like you have two moving targets, try with the new program and MSVC 2010 or the old program (that worked) and MSVC 2015. Which Qt version are you using now and which Qt version did the working application use? - Frank Osterfeld
I tried to disable all firewalls and antiviruses, does not help. @Frank Osterfeld The codebase is exactly the same. I upgraded the compiler and went from Qt 5.3 to 5.5. I also updated OpenSSL version and change Qt compile from static to dynamic libs. I did a diff between old downloader and current one now, it is exactly the same code. - cen

1 Answers

0
votes

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