]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Ignore control port commands after a QUIT
authorMarcus Griep <marcus@griep.us>
Wed, 24 Jun 2009 03:14:44 +0000 (23:14 -0400)
committerMarcus Griep <marcus@griep.us>
Wed, 24 Jun 2009 04:10:22 +0000 (00:10 -0400)
When a QUIT has been issued on a control port connection, then
ignore further commands on that port. This fixes bug 1016.

src/or/control.c

index 98c6aa458cb59f9a1509dd9a6937a991eaebbfa9..90c99fd51abbb82e512e618a66d9d0bcec32e159 100644 (file)
@@ -2888,7 +2888,12 @@ connection_control_process_inbuf(control_connection_t *conn)
     --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")) {
     connection_write_str_to_buf("250 closing connection\r\n", conn);
     connection_mark_for_close(TO_CONN(conn));