[mythtv] GetMythDownloadManager -> download returning stale data?
cpinkham at bc2va.org
Wed Sep 5 21:19:44 UTC 2012
* On Wed Sep 05, 2012 at 03:15:36PM -0500, Robert Kulagowski wrote:
> 2012-09-05 14:38:16.427312 I Downloaded file /tmp/11848_sched.txt
> 2012-09-05 14:38:20.833061 I Downloaded file /tmp/12475_sched.txt
> 2012-09-05 14:38:25.236396 I Downloaded file /tmp/14789_sched.txt
> 2012-09-05 14:38:29.441170 I Downloaded file /tmp/27549_sched.txt
> This is where it starts to break down:
> 2012-09-05 14:38:39.447517 I Downloaded file /tmp/60165_sched.txt
> 2012-09-05 14:38:49.454275 I Downloaded file /tmp/74348_sched.txt
> 2012-09-05 14:38:59.460241 I Downloaded file /tmp/76943_sched.txt
> GetMythDownloadManager()->download(url, &dl_file, false);
You need to check the status of ::download() here. It returns true or
false for success/fail. Your later downloads are hitting the 10-second
timeout in MythDownloadManager::downloadNow(). If we don't receive a
status update from QNetworkAccessManager within 10 seconds of the
last status, the code times out and returns false.
This is why you're seeing the same data if you have the QByteArray
outside the loop but 0 bytes of data if you create the QByteArray
inside the loop.
Also, have you tried just letting the webserver compress and
QNetworkAccessManager/client decompress the data instead of
pre-compressing and having to gUncompress it after you download it?
That might eliminate some of the delay. We could bump up the timeout
if necessary, but don't want it to be too high by default. If you want
to do this for testing, edit libs/libmythbase/mythdownloadmanager.cpp
around line 804, change the 10 to 30 or 60. Because of the way we
abort the download, the actual download is completed in the background
by QNetworkAccessManager, so the server sees a successful download.
More information about the mythtv-dev