mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
*** empty log message ***
This commit is contained in:
parent
8a3d2c633c
commit
f5479d95aa
@ -351,6 +351,11 @@ process_request() {
|
|||||||
<< "Downloader::process_request() - downloading complete for "
|
<< "Downloader::process_request() - downloading complete for "
|
||||||
<< tok->_file_name << "\n";
|
<< tok->_file_name << "\n";
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
PT_Event failure = new Event(tok->_event_name);
|
||||||
|
failure->add_parameter(EventParameter((int)tok->_id));
|
||||||
|
failure->add_parameter(EventParameter(0));
|
||||||
|
failure->add_parameter(EventParameter(-1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -701,13 +706,22 @@ parse_header(DownloadStatus &status) {
|
|||||||
if (status._header_is_complete == true)
|
if (status._header_is_complete == true)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (status._total_bytes == 0) {
|
||||||
|
downloader_cat.error()
|
||||||
|
<< "Downloader::parse_header() - Total bytes == 0!" << endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
string bufstr((char *)status._start, status._bytes_in_buffer);
|
string bufstr((char *)status._start, status._bytes_in_buffer);
|
||||||
size_t p = 0;
|
size_t p = 0;
|
||||||
while (p < bufstr.length()) {
|
while (p < bufstr.length()) {
|
||||||
// Server sends out CR LF (\r\n) as newline delimiter
|
// Server sends out CR LF (\r\n) as newline delimiter
|
||||||
size_t nl = bufstr.find("\015\012", p);
|
size_t nl = bufstr.find("\015\012", p);
|
||||||
if (nl == string::npos)
|
if (nl == string::npos) {
|
||||||
return true;
|
downloader_cat.error()
|
||||||
|
<< "Downloader::parse_header() - No newlines in buffer!" << endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
string component = bufstr.substr(p, nl - p);
|
string component = bufstr.substr(p, nl - p);
|
||||||
|
|
||||||
@ -768,10 +782,12 @@ parse_header(DownloadStatus &status) {
|
|||||||
p = nl + 2;
|
p = nl + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status._total_bytes == 0) {
|
if (status._header_is_complete == false) {
|
||||||
downloader_cat.error()
|
if (downloader_cat.is_debug())
|
||||||
<< "Downloader::parse_header() - Total bytes == 0!" << endl;
|
downloader_cat.debug()
|
||||||
return false;
|
<< "Downloader::parse_header() - Reached end of buffer without "
|
||||||
|
<< "successfully parsing the header - buffer size: "
|
||||||
|
<< status._bytes_in_buffer << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user