diff --git a/panda/src/downloader/httpChannel.I b/panda/src/downloader/httpChannel.I index 32a5beab02..245a763407 100644 --- a/panda/src/downloader/httpChannel.I +++ b/panda/src/downloader/httpChannel.I @@ -75,6 +75,13 @@ get_http_version_string() const { // retrieval request. This will be in the 200 range if // the document is successfully retrieved, or some other // value in the case of an error. +// +// Some proxy errors during an https-over-proxy request +// would return the same status code as a different +// error that occurred on the host server. To +// differentiate these cases, status codes that are +// returned by the proxy during the CONNECT phase +// (except code 407) are incremented by 1000. //////////////////////////////////////////////////////////////////// INLINE int HTTPChannel:: get_status_code() const { diff --git a/panda/src/downloader/httpChannel.cxx b/panda/src/downloader/httpChannel.cxx index b3079e5828..655a602001 100644 --- a/panda/src/downloader/httpChannel.cxx +++ b/panda/src/downloader/httpChannel.cxx @@ -686,6 +686,14 @@ run_proxy_reading_header() { if (!is_valid()) { // Proxy wouldn't open connection. + + // Change some of the status codes a proxy might return to + // differentiate them from similar status codes the destination + // server might have returned. + if (get_status_code() != 407) { + _status_code += 1000; + } + _state = S_failure; return false; }