Browse Source

Merge commit 'origin/maint-0.2.1'

Nick Mathewson 16 years ago
parent
commit
d2cac1afc3
2 changed files with 17 additions and 1 deletions
  1. 10 0
      ChangeLog
  2. 7 1
      src/or/control.c

+ 10 - 0
ChangeLog

@@ -51,6 +51,16 @@ Changes in version 0.2.1.17-?? - 2009-??-??
       authorities start doing active measurements. Implements more of
       authorities start doing active measurements. Implements more of
       proposal 141.
       proposal 141.
 
 
+  o Minor bugfixes (on 0.2.0.x):
+    - Control port would close the connection before flushing long
+      replies, such as the network consensus, if a QUIT command was
+      issued before the reply had completed. Now, the control port
+      flushes all pending replies before closing the connection.
+      Also fixed a condition where a QUIT command issued after a
+      malformed or rejected AUTHENTICATE command, but before the
+      connection was closed would result in a warning in the logger
+      for a doubly-closed connection. Fixes bugs 1015 and 1016.
+
 
 
 Changes in version 0.2.1.16-rc - 2009-06-20
 Changes in version 0.2.1.16-rc - 2009-06-20
   o Security fixes:
   o Security fixes:

+ 7 - 1
src/or/control.c

@@ -2780,10 +2780,16 @@ connection_control_process_inbuf(control_connection_t *conn)
     --data_len;
     --data_len;
   }
   }
 
 
-  /* Quit is always valid. */
+  /* If the connection is already closing, ignore further commands */
+  if (TO_CONN(conn)->marked_for_close) {
+    return 0;
+  }
+
+  /* Otherwise, Quit is always valid. */
   if (!strcasecmp(conn->incoming_cmd, "QUIT")) {
   if (!strcasecmp(conn->incoming_cmd, "QUIT")) {
     connection_write_str_to_buf("250 closing connection\r\n", conn);
     connection_write_str_to_buf("250 closing connection\r\n", conn);
     connection_mark_for_close(TO_CONN(conn));
     connection_mark_for_close(TO_CONN(conn));
+    conn->_base.hold_open_until_flushed = 1;
     return 0;
     return 0;
   }
   }