aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2002-07-16 02:12:58 +0000
committerRoger Dingledine <arma@torproject.org>2002-07-16 02:12:58 +0000
commitc951c6f1866b29ffef025238bfc4e51ed4acbe4d (patch)
tree539d939cc4958c61807ef09e882d91c20331a0f3 /src/or
parent117cbeeaaf30cdbbfe79dbe92fe47ab6a531bd8a (diff)
downloadtor-c951c6f1866b29ffef025238bfc4e51ed4acbe4d.tar
tor-c951c6f1866b29ffef025238bfc4e51ed4acbe4d.tar.gz
new config files, some bugfixes
svn:r51
Diffstat (limited to 'src/or')
-rw-r--r--src/or/buffers.c4
-rw-r--r--src/or/connection.c2
-rw-r--r--src/or/main.c8
3 files changed, 7 insertions, 7 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index 65699ebb4..a14cf0d97 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -79,9 +79,7 @@ int flush_buf(int s, char **buf, size_t *buflen, size_t *buf_flushlen, size_t *b
/* this is the point where you would grow the buffer, if you want to */
- write_result = write(s, *buf, *buf_flushlen > 10240 ? 10240 : *buf_flushlen);
- /* try to flush at most 10240 bytes at a time. otherwise write() can hang for
- * quite a while trying to get it all out. that's bad. */
+ write_result = write(s, *buf, *buf_flushlen);
if (write_result < 0) {
if(errno!=EAGAIN) { /* it's a real error */
return -1;
diff --git a/src/or/connection.c b/src/or/connection.c
index 8b4155d15..b0ca98322 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -180,6 +180,8 @@ int connection_handle_listener_read(connection_t *conn, int new_type, int new_st
}
log(LOG_DEBUG,"Connection accepted on socket %d.",news);
+ fcntl(news, F_SETFL, O_NONBLOCK); /* set s to non-blocking */
+
newconn = connection_new(new_type);
newconn->s = news;
diff --git a/src/or/main.c b/src/or/main.c
index 6a7643a63..69dc4a241 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -38,7 +38,7 @@ 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 */
- log(LOG_DEBUG,"connection_add(): failing because nfds is too high.");
+ log(LOG_INFO,"connection_add(): failing because nfds is too high.");
return -1;
}
@@ -52,7 +52,7 @@ int connection_add(connection_t *conn) {
nfds++;
- log(LOG_DEBUG,"connection_add(): new conn type %d, socket %d, nfds %d.",conn->type, conn->s, nfds);
+ log(LOG_INFO,"connection_add(): new conn type %d, socket %d, nfds %d.",conn->type, conn->s, nfds);
return 0;
@@ -74,7 +74,7 @@ int connection_remove(connection_t *conn) {
if(current_index == nfds-1) { /* this is the end */
// connection_free(conn);
nfds--;
- log(LOG_DEBUG,"connection_remove(): nfds now %d.",nfds);
+ log(LOG_INFO,"connection_remove(): nfds now %d.",nfds);
return 0;
}
@@ -86,7 +86,7 @@ int connection_remove(connection_t *conn) {
connection_array[current_index] = connection_array[nfds];
connection_array[current_index]->poll_index = current_index;
- log(LOG_DEBUG,"connection_remove(): nfds now %d.",nfds);
+ log(LOG_INFO,"connection_remove(): nfds now %d.",nfds);
return 0;
}