diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-02-28 04:34:27 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-02-28 04:34:27 +0000 |
commit | b4a7883c90716aed9362340e2905baf8d5c049c5 (patch) | |
tree | f397d65672e5a4ebd9a625e9f0adf0ff023430a1 /src/or/main.c | |
parent | ee68371f41def2fff7ef92f715c858bbe1b36c2f (diff) | |
download | tor-b4a7883c90716aed9362340e2905baf8d5c049c5.tar tor-b4a7883c90716aed9362340e2905baf8d5c049c5.tar.gz |
make code more readable; arrbitrarily change a -1 to a 0.
svn:r1151
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/or/main.c b/src/or/main.c index d7a10cf5f..88fe73820 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -176,13 +176,14 @@ static void conn_read(int i) { #ifdef MS_WINDOWS (poll_array[i].revents & POLLERR) || #endif - (connection_handle_read(conn) < 0 && !conn->marked_for_close)) - { - /* this connection is broken. remove it */ - /* XXX This shouldn't ever happen anymore. */ - log_fn(LOG_ERR,"Unhandled error on read for %s connection (fd %d); removing", - conn_type_to_string[conn->type], conn->s); - connection_mark_for_close(conn,0); + connection_handle_read(conn) < 0) { + if (!conn->marked_for_close) { + /* this connection is broken. remove it */ + /* XXX This shouldn't ever happen anymore. */ + log_fn(LOG_ERR,"Unhandled error on read for %s connection (fd %d); removing", + conn_type_to_string[conn->type], conn->s); + connection_mark_for_close(conn,0); + } } assert_connection_ok(conn, time(NULL)); } @@ -200,11 +201,13 @@ static void conn_write(int i) { assert_connection_ok(conn, time(NULL)); - if(connection_handle_write(conn) < 0 && !conn->marked_for_close) { - /* this connection is broken. remove it. */ - log_fn(LOG_ERR,"Unhandled error on read for %s connection (fd %d); removing", - conn_type_to_string[conn->type], conn->s); - connection_mark_for_close(conn,0); + if (connection_handle_write(conn) < 0) { + if (!conn->marked_for_close) { + /* this connection is broken. remove it. */ + log_fn(LOG_ERR,"Unhandled error on read for %s connection (fd %d); removing", + conn_type_to_string[conn->type], conn->s); + connection_mark_for_close(conn,0); + } } assert_connection_ok(conn, time(NULL)); } |