aboutsummaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 88fe73820..7bec18ab6 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -158,6 +158,9 @@ void connection_start_writing(connection_t *conn) {
static void conn_read(int i) {
connection_t *conn = connection_array[i];
+ if (conn->marked_for_close)
+ return;
+
/* see http://www.greenend.org.uk/rjk/2001/06/poll.html for
* discussion of POLLIN vs POLLHUP */
if(!(poll_array[i].revents & (POLLIN|POLLHUP|POLLERR)))
@@ -165,8 +168,6 @@ static void conn_read(int i) {
!connection_has_pending_tls_data(conn))
return; /* this conn should not read */
- if (conn->marked_for_close)
- return;
log_fn(LOG_DEBUG,"socket %d wants to read.",conn->s);
assert_connection_ok(conn, time(NULL));
@@ -204,7 +205,7 @@ static void conn_write(int i) {
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",
+ log_fn(LOG_WARN,"Unhandled error on read for %s connection (fd %d); removing",
conn_type_to_string[conn->type], conn->s);
connection_mark_for_close(conn,0);
}