瀏覽代碼

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

Nick Mathewson 11 年之前
父節點
當前提交
7ccaf3f1a4
共有 2 個文件被更改,包括 9 次插入0 次删除
  1. 5 0
      changes/bug8427
  2. 4 0
      src/or/connection.c

+ 5 - 0
changes/bug8427

@@ -0,0 +1,5 @@
+  o Minor bugfixes:
+    - If we encounter a write failure on a SOCKS connection before we
+      finish our SOCKS handshake, don't warn that we closed the
+      connection before we could send a SOCKS reply. Fixes bug 8427;
+      bugfix on 0.1.0.1-rc.

+ 4 - 0
src/or/connection.c

@@ -3550,6 +3550,10 @@ connection_handle_write_impl(connection_t *conn, int force)
     if (result < 0) {
       if (CONN_IS_EDGE(conn))
         connection_edge_end_errno(TO_EDGE_CONN(conn));
+      if (conn->type == CONN_TYPE_AP) {
+        /* writing failed; we couldn't send a SOCKS reply if we wanted to */
+        TO_ENTRY_CONN(conn)->socks_request->has_finished = 1;
+      }
 
       connection_close_immediate(conn); /* Don't flush; connection is dead. */
       connection_mark_for_close(conn);