QNerworkReply readyRead doesn't fire in some cases
I am using QT-4.6.2 QNetworkAccessManager for a http download application. The application requests files from remote server and show the progress of downloading after connection.
The program is quite similar from QT sample project, downloadmanager.
@ QNetworkRequest request(url);
m_currDownload = m_manager.get(request);
connect(m_currDownload, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(handleDownloadProgress(qint64,qint64)));
connect(m_currDownload, SIGNAL(finished()), this, SLOT(downloadFinished()));
connect(m_currDownload, SIGNAL(readyRead()), this, SLOT(downloadReadyRead()));@
And everything is fine in MY COMPUTER.
The problem I have is that in some computers, ONLY the EXE file (application) can't be downloaded though other file types could be downloaded successfully.
From the Log I created, when downloading EXE file, the readyRead signal didn't fire. The program just fired finished signal and set the downloading to finished status. But it didn't get one single byte.
- copy all the QT libraries to other computer. didn't work;
2.use waitForReadyRead after get(request). didn't work. And someone pointed out that function does nothing: "http://lists.trolltech.com/pipermail/qt-interest/2010-April/022028.html":http://lists.trolltech.com/pipermail/qt-interest/2010-April/022028.html
3.use QEventLoop to block readyRead or finished before saving content, didn't work.
4.check isFinished or sleep some seconds before downloading, still didn't work.
Well, i tried the QT sample program on that computer: download, downloadmanger and http. Those programs have the same problem. Can't download the EXE file.
I also checked if the computer has block exe downloading, but from browser or other download application, the EXE file could be downloaded.
Does anyone meet this before?
[edit: fixed link / $chetankjain]
What about downloadProgress(), is it working for exe files?
If not, do you have access to the server log? Are you sure the connections is being established?
Have you tried wireshark to make sure which packages are travelling?
It sounds a firewall issue to me...
No. the downloadProgress wasn't triggered either.
And it's not the firewall issue, I checked that computer, the windows firewall was disabled and non anti-virus software had been installed.
Unfortunately, I am not able to access the server log, but I will try your suggestion to use wireshark to analyze. Thanks.
The issue has been solved after analysis the network packet.
The server ONLY redirects exe link to other address and I didn't check the reply code.
Now the reply code from server has been checked in case of any redirection and the exe file could be downloaded as well as other types.
But I still has the question, I didn't handle redirection before, why it worked on some machines?