Browse Source

return status code + 1000 for proxy errors

David Rose 23 years ago
parent
commit
f3d2ac3103
2 changed files with 15 additions and 0 deletions
  1. 7 0
      panda/src/downloader/httpChannel.I
  2. 8 0
      panda/src/downloader/httpChannel.cxx

+ 7 - 0
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 {

+ 8 - 0
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;
   }