summaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-10-13 13:08:38 -0400
committerNick Mathewson <nickm@torproject.org>2010-10-13 13:08:46 -0400
commita0c1c2ac012fded493c0d8c49fe57e56373b061f (patch)
treeb39fcdda6348700e02ce17c18b3221c0b1f64fcd /src/or/control.c
parent5710d99f00b3ac7cef0691fc9153993b0f4aa872 (diff)
downloadtor-a0c1c2ac012fded493c0d8c49fe57e56373b061f.tar.gz
tor-a0c1c2ac012fded493c0d8c49fe57e56373b061f.zip
Use connection_mark_and_flush consistently.
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 37ebfd88dc..4c32b5b147 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -2798,8 +2798,8 @@ connection_control_process_inbuf(control_connection_t *conn)
body_len = 2+strlen(buf+6)+2; /* code, msg, nul. */
set_uint16(buf+0, htons(body_len));
connection_write_to_buf(buf, 4+body_len, TO_CONN(conn));
- connection_mark_for_close(TO_CONN(conn));
- conn->_base.hold_open_until_flushed = 1;
+
+ connection_mark_and_flush(TO_CONN(conn));
return 0;
}
@@ -2820,8 +2820,7 @@ connection_control_process_inbuf(control_connection_t *conn)
if (data_len + conn->incoming_cmd_cur_len > MAX_COMMAND_LINE_LENGTH) {
connection_write_str_to_buf("500 Line too long.\r\n", conn);
connection_stop_reading(TO_CONN(conn));
- connection_mark_for_close(TO_CONN(conn));
- conn->_base.hold_open_until_flushed = 1;
+ connection_mark_and_flush(TO_CONN(conn));
}
while (conn->incoming_cmd_len < data_len+conn->incoming_cmd_cur_len)
conn->incoming_cmd_len *= 2;
@@ -2880,8 +2879,7 @@ connection_control_process_inbuf(control_connection_t *conn)
/* 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;
+ connection_mark_and_flush(TO_CONN(conn));
return 0;
}