fix bogus error return on timeout for gameserver connect

This commit is contained in:
David Rose 2003-11-15 18:35:32 +00:00
parent 836ddd0aff
commit 9b0507a4c6
3 changed files with 27 additions and 2 deletions

View File

@ -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;
}

View File

@ -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();
}

View File

@ -281,6 +281,7 @@ public:
private:
class StatusEntry {
public:
INLINE StatusEntry();
int _status_code;
string _status_string;
};