diff --git a/panda/src/downloader/httpChannel.I b/panda/src/downloader/httpChannel.I index 75cb4d77e8..3d269ca589 100644 --- a/panda/src/downloader/httpChannel.I +++ b/panda/src/downloader/httpChannel.I @@ -847,3 +847,13 @@ is_download_complete() const { return (_download_dest != DD_none && (_state == S_read_body || _state == S_read_trailer)); } + +//////////////////////////////////////////////////////////////////// +// Function: HTTPChannel::StatusEntry::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE HTTPChannel::StatusEntry:: +StatusEntry() { + _status_code = SC_incomplete; +} diff --git a/panda/src/downloader/httpChannel.cxx b/panda/src/downloader/httpChannel.cxx index d0a50c37c5..0587c7ca01 100644 --- a/panda/src/downloader/httpChannel.cxx +++ b/panda/src/downloader/httpChannel.cxx @@ -745,17 +745,31 @@ reached_done_state() { // response; go back and find the best one. if (!_status_list.empty()) { _status_list.push_back(_status_entry); - if (downloader_cat.is_spam()) { - downloader_cat.spam() + if (downloader_cat.is_debug()) { + downloader_cat.debug() << "Reexamining failure responses.\n"; } size_t best_i = 0; + if (downloader_cat.is_debug()) { + downloader_cat.debug() + << " " << 0 << ". " << _status_list[0]._status_code << " " + << _status_list[0]._status_string << "\n"; + } for (size_t i = 1; i < _status_list.size(); i++) { + if (downloader_cat.is_debug()) { + downloader_cat.debug() + << " " << i << ". " << _status_list[i]._status_code << " " + << _status_list[i]._status_string << "\n"; + } if (more_useful_status_code(_status_list[i]._status_code, _status_list[best_i]._status_code)) { best_i = i; } } + if (downloader_cat.is_debug()) { + downloader_cat.debug() + << "chose index " << best_i << ", above.\n"; + } _status_entry = _status_list[best_i]; _status_list.clear(); } diff --git a/panda/src/downloader/httpChannel.h b/panda/src/downloader/httpChannel.h index 00d5006b15..afb54f6d61 100644 --- a/panda/src/downloader/httpChannel.h +++ b/panda/src/downloader/httpChannel.h @@ -281,6 +281,7 @@ public: private: class StatusEntry { public: + INLINE StatusEntry(); int _status_code; string _status_string; };