aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-11-21 10:14:57 +0000
committerRoger Dingledine <arma@torproject.org>2004-11-21 10:14:57 +0000
commit310a8da0d2ef457a245843268677f50c6ea84a98 (patch)
treebc735fce476d9c687c9aa19bdfd93963fbad874c /src/or/control.c
parent671d84dc2f02d8d39f66582add2324ecb2590728 (diff)
downloadtor-310a8da0d2ef457a245843268677f50c6ea84a98.tar.gz
tor-310a8da0d2ef457a245843268677f50c6ea84a98.zip
break reached_eof() out of process_inbuf()
svn:r2930
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/or/control.c b/src/or/control.c
index a25e0806d0..92297f3501 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -391,8 +391,15 @@ connection_control_finished_flushing(connection_t *conn) {
return 0;
}
-/** Called when <b>conn</b> has received more bytes on its inbuf, or has
- * gotten its socket closed. */
+/** Called when <b>conn</b> has gotten its socket closed. */
+int connection_control_reached_eof(connection_t *conn) {
+ log_fn(LOG_INFO,"Control connection reached EOF. Closing.");
+ connection_mark_for_close(conn);
+ return 0;
+}
+
+/** Called when <b>conn</b> has received more bytes on its inbuf.
+ */
int
connection_control_process_inbuf(connection_t *conn) {
uint16_t body_len, command_type;
@@ -401,12 +408,6 @@ connection_control_process_inbuf(connection_t *conn) {
tor_assert(conn);
tor_assert(conn->type == CONN_TYPE_CONTROL);
- if(conn->inbuf_reached_eof) {
- log_fn(LOG_INFO,"Control connection reached EOF. Closing.");
- connection_mark_for_close(conn);
- return 0;
- }
-
again:
/* Try to suck a control message from the buffer. */
switch(fetch_from_buf_control(conn->inbuf, &body_len, &command_type, &body))