Opened 10 years ago

Last modified 7 years ago

#1015 closed defect (Fixed)

Control port closes on QUIT before flushing

Reported by: neoeinstein Owned by:
Priority: Low Milestone:
Component: Core Tor/Tor Version: 0.2.1.15-rc
Severity: Keywords:
Cc: neoeinstein, nickm Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

If a synchronous command is issued to the control port which
has a long reply, and is followed immediately by a QUIT command,
the connection may be closed before the first command's reply
can be flushed.

"""
cat <<EOF | nc localhost 9051 > consensus
AUTHENTICATE
GETINFO dir/status-vote/current/consensus
QUIT
EOF
"""

The above will cut off before reaching the end of the consensus
document and close the connection.

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (4)

comment:1 Changed 10 years ago by neoeinstein

Patch that resolves this issue:

"""
diff --git a/src/or/control.c b/src/or/control.c
index e2ab9f3..ae737cf 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -2783,7 +2783,8 @@ connection_control_process_inbuf(control_connection_t *conn)

/* 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;

}

"""

comment:2 Changed 10 years ago by nickm

Fixed in fa89c9f0868d4902e0298ac9ef23e521633f933b

comment:3 Changed 10 years ago by nickm

flyspray2trac: bug closed.

comment:4 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.