diff options
author | Roger Dingledine <arma@torproject.org> | 2002-09-03 18:36:40 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2002-09-03 18:36:40 +0000 |
commit | 27adc0f20bd0d5f0e5b90a695394518072316d8d (patch) | |
tree | 55d1c382625bd234734c21bc1850e86f3629c830 /src/or/main.c | |
parent | db4c2140c36be56fdcdd1f5a0af88006c225f67b (diff) | |
download | tor-27adc0f20bd0d5f0e5b90a695394518072316d8d.tar.gz tor-27adc0f20bd0d5f0e5b90a695394518072316d8d.zip |
enforce maxconn; bugfix to not tear down the parent when we hit maxconn
svn:r86
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/or/main.c b/src/or/main.c index d1b49d05b0..2b9fefa529 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -36,8 +36,7 @@ static int rarray_len = 0; int connection_add(connection_t *conn) { - if(nfds >= MAXCONNECTIONS-2) { /* 2, for some breathing room. should count the fenceposts. */ - /* FIXME should use the 'max connections' option */ + if(nfds >= options.MaxConn-1) { log(LOG_INFO,"connection_add(): failing because nfds is too high."); return -1; } @@ -55,7 +54,6 @@ int connection_add(connection_t *conn) { log(LOG_INFO,"connection_add(): new conn type %d, socket %d, nfds %d.",conn->type, conn->s, nfds); return 0; - } void connection_set_poll_socket(connection_t *conn) { @@ -73,7 +71,6 @@ int connection_remove(connection_t *conn) { current_index = conn->poll_index; if(current_index == nfds-1) { /* this is the end */ -// connection_free(conn); nfds--; return 0; } |