*** empty log message ***

This commit is contained in:
Mike Goslin 2001-02-01 18:37:51 +00:00
parent f7f44a3e18
commit 6dba71307a
2 changed files with 20 additions and 1 deletions

View File

@ -718,6 +718,13 @@ parse_http_response(const string &resp) {
case 204:
case 205:
break;
case 302:
if (downloader_cat.is_debug())
downloader_cat.debug()
<< "Downloader::parse_http_response() - got a 302 redirect"
<< endl;
return EU_http_redirect;
break;
case 408:
return EU_error_http_server_timeout;
case 503:
@ -776,6 +783,7 @@ parse_header(DownloadStatus *status) {
// The first line of the response should say whether
// got an error or not
bool redirect = false;
if (status->_first_line_complete == false) {
status->_first_line_complete = true;
int parse_ret = parse_http_response(component);
@ -785,12 +793,15 @@ parse_header(DownloadStatus *status) {
<< "Downloader::parse_header() - Header is valid: "
<< component << endl;
status->_header_is_valid = true;
} else if (parse_ret == EU_http_redirect) {
redirect = true;
status->_header_is_valid = true;
} else {
return parse_ret;
}
}
// Look for content length
// Look for content length and location
size_t cpos = component.find(":");
string tline = component.substr(0, cpos);
if (status->_partial_content == true && tline == "Content-Length") {
@ -807,6 +818,13 @@ parse_header(DownloadStatus *status) {
<< status->_last_byte << "-" << status->_first_byte << ")" << endl;
return EU_error_abort;
}
} else if (redirect == true && tline == "Location") {
tline = component.substr(cpos + 2, string::npos);
if (downloader_cat.is_debug())
downloader_cat.debug()
<< "Downloader::parse_header() - file redirected to: "
<< tline << endl;
return EU_error_abort;
}
// Two consecutive (CR LF)s indicates end of HTTP header

View File

@ -12,6 +12,7 @@
BEGIN_PUBLISH
enum ErrorUtilCode {
EU_http_redirect = 7,
EU_eof = 6,
EU_network_no_data = 5,