浏览代码

Merge remote-tracking branch 'origin/maint-0.2.2'

Nick Mathewson 14 年之前
父节点
当前提交
696cd1cfe2
共有 2 个文件被更改,包括 18 次插入4 次删除
  1. 4 0
      changes/bug2503
  2. 14 4
      src/or/connection.c

+ 4 - 0
changes/bug2503

@@ -0,0 +1,4 @@
+  o Minor features:
+    - When an HTTPS proxy reports "403 Forbidden", we now explain
+      what it means rather than calling it an unexpected status code.
+      Closes bug 2503.  Patch from "mikey". 

+ 14 - 4
src/or/connection.c

@@ -1547,10 +1547,20 @@ connection_read_https_proxy_response(connection_t *conn)
     return 1;
   }
   /* else, bad news on the status code */
-  log_warn(LD_NET,
-           "The https proxy sent back an unexpected status code %d (%s). "
-           "Closing.",
-           status_code, escaped(reason));
+  switch (status_code) {
+    case 403:
+      log_warn(LD_NET,
+             "The https proxy refused to allow connection to %s "
+             "(status code %d, %s). Closing.",
+             conn->address, status_code, escaped(reason));
+      break;
+    default:
+      log_warn(LD_NET,
+             "The https proxy sent back an unexpected status code %d (%s). "
+             "Closing.",
+             status_code, escaped(reason));
+      break;
+  }
   tor_free(reason);
   return -1;
 }