diff options
author | Marcus Griep <marcus@griep.us> | 2009-06-23 23:14:44 -0400 |
---|---|---|
committer | Marcus Griep <marcus@griep.us> | 2009-06-24 00:10:22 -0400 |
commit | d3087389196b585ab4e0b5ee64fc36b16f071eef (patch) | |
tree | b7257d9cdceb52958e33161e2718b06145eb0d2c | |
parent | fa89c9f0868d4902e0298ac9ef23e521633f933b (diff) | |
download | tor-d3087389196b585ab4e0b5ee64fc36b16f071eef.tar.gz tor-d3087389196b585ab4e0b5ee64fc36b16f071eef.zip |
Ignore control port commands after a QUIT
When a QUIT has been issued on a control port connection, then
ignore further commands on that port. This fixes bug 1016.
-rw-r--r-- | src/or/control.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/control.c b/src/or/control.c index 98c6aa458c..90c99fd51a 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -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)); |