|
@@ -331,7 +331,9 @@ contents_file_download_finished(bool success) {
|
|
|
// Access: Private
|
|
// Access: Private
|
|
|
// Description: Starts a new download attempt of contents.xml, to
|
|
// Description: Starts a new download attempt of contents.xml, to
|
|
|
// check to see whether our local copy is stale. This
|
|
// check to see whether our local copy is stale. This
|
|
|
-// is called only from Download::download_finished().
|
|
|
|
|
|
|
+// is called only from download_desc_file(), or from
|
|
|
|
|
+// Download::download_finished(). If the former, the
|
|
|
|
|
+// download pointer will be NULL.
|
|
|
//
|
|
//
|
|
|
// If it turns out a new version can be downloaded, the
|
|
// If it turns out a new version can be downloaded, the
|
|
|
// indicated Download object (and the current install
|
|
// indicated Download object (and the current install
|
|
@@ -403,20 +405,30 @@ contents_file_redownload_finished(bool success) {
|
|
|
delete _temp_contents_file;
|
|
delete _temp_contents_file;
|
|
|
_temp_contents_file = NULL;
|
|
_temp_contents_file = NULL;
|
|
|
|
|
|
|
|
- assert(_saved_download != NULL);
|
|
|
|
|
if (contents_changed) {
|
|
if (contents_changed) {
|
|
|
// OK, the contents.xml has changed; this means we have to restart
|
|
// OK, the contents.xml has changed; this means we have to restart
|
|
|
// the whole download process from the beginning.
|
|
// the whole download process from the beginning.
|
|
|
|
|
+ nout << "Redownloading contents.xml made a difference.\n";
|
|
|
set_saved_download(NULL);
|
|
set_saved_download(NULL);
|
|
|
host_got_contents_file();
|
|
host_got_contents_file();
|
|
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
// Nothing's changed. This was just a useless diversion. We now
|
|
// Nothing's changed. This was just a useless diversion. We now
|
|
|
// return you to our regularly scheduled download.
|
|
// return you to our regularly scheduled download.
|
|
|
|
|
+ nout << "Redownloading contents.xml didn't help.\n";
|
|
|
Download *download = _saved_download;
|
|
Download *download = _saved_download;
|
|
|
_saved_download = NULL;
|
|
_saved_download = NULL;
|
|
|
- download->resume_download_finished(false);
|
|
|
|
|
- unref_delete(download);
|
|
|
|
|
|
|
+ if (download == NULL) {
|
|
|
|
|
+ // But, if _saved_download was NULL (meaning NULL was passed to
|
|
|
|
|
+ // redownload_contents_file(), above), it means that we were
|
|
|
|
|
+ // called from download_desc_file(), and there's nothing more to
|
|
|
|
|
+ // do. We're just hosed.
|
|
|
|
|
+ report_done(false);
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ download->resume_download_finished(false);
|
|
|
|
|
+ unref_delete(download);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -485,7 +497,7 @@ download_desc_file() {
|
|
|
_package_name, _package_version)) {
|
|
_package_name, _package_version)) {
|
|
|
nout << "Couldn't find package " << _package_fullname
|
|
nout << "Couldn't find package " << _package_fullname
|
|
|
<< " in contents file.\n";
|
|
<< " in contents file.\n";
|
|
|
- report_done(false);
|
|
|
|
|
|
|
+ redownload_contents_file(NULL);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|