diff --git a/ChangeLog b/ChangeLog index 086618c35b..88b2343059 100644 --- a/ChangeLog +++ b/ChangeLog @@ -51,6 +51,16 @@ Changes in version 0.2.1.17-?? - 2009-??-?? authorities start doing active measurements. Implements more of 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 o Security fixes: diff --git a/src/or/control.c b/src/or/control.c index e2ab9f31c5..662da98ec1 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -2780,10 +2780,16 @@ 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)); + conn->_base.hold_open_until_flushed = 1; return 0; }