diff options
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/or/main.c b/src/or/main.c index 122af87bb..8c757bedf 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -54,6 +54,7 @@ int has_completed_circuit=0; int connection_add(connection_t *conn) { tor_assert(conn); + tor_assert(conn->s >= 0); if(nfds >= options.MaxConn-1) { log_fn(LOG_WARN,"failing because nfds is too high."); @@ -61,10 +62,10 @@ int connection_add(connection_t *conn) { } conn->poll_index = nfds; - connection_set_poll_socket(conn); connection_array[nfds] = conn; /* zero these out here, because otherwise we'll inherit values from the previously freed one */ + poll_array[nfds].fd = conn->s; poll_array[nfds].events = 0; poll_array[nfds].revents = 0; @@ -76,10 +77,6 @@ int connection_add(connection_t *conn) { return 0; } -void connection_set_poll_socket(connection_t *conn) { - poll_array[conn->poll_index].fd = conn->s; -} - /* Remove the connection from the global list, and remove the * corresponding poll entry. Calling this function will shift the last * connection (if any) into the position occupied by conn. |