B
B
becks2013-06-17 17:27:07
Qt
becks, 2013-06-17 17:27:07

Incorrect work of one of the examples in the Qt distribution. Explain why?

I'm parsing the downloadmanager example from the standard Qt distribution (examples\network\downloadmanager). The example demonstrates how using the QNetworkRequest , QNetworkReply , QNetworkAccessManager classes, you can successfully sequentially download pages from the Internet using a list of urls. Everything in it is clear and everything seems to be correct. But I noticed that contact (vk) pages are not downloaded, i.e. the file is created empty.

QNetworkRequest request(url);
    currentDownload = manager.get(request);
    connect(currentDownload, SIGNAL(downloadProgress(qint64,qint64)), SLOT(downloadProgress(qint64,qint64)));
    connect(currentDownload, SIGNAL(finished()), SLOT(downloadFinished()));
    connect(currentDownload, SIGNAL(readyRead()), SLOT(downloadReadyRead()));

Well, actually writing to the file itself:
void DownloadManager::downloadReadyRead()
{
    output.write(currentDownload->readAll());
}

Only vk never emits the readyRead signal and never writes to the file.
It would be interesting to understand why this happens.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
gaelpa, 2013-06-17
@gaelpa

Look, for example, with wireshark for network exchange with VK when working from a browser and from a QT application. Surely some kind of redirect to some https happens there, for example, with the lack of the necessary cookies when requested from qt.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question