[or-cvs] new config files, some bugfixes

Roger Dingledine arma at seul.org
Tue Jul 16 02:13:00 UTC 2002


Update of /home/or/cvsroot/src/or
In directory moria.seul.org:/home/arma/work/onion/cvs/src/or

Modified Files:
	buffers.c connection.c main.c 
Log Message:
new config files, some bugfixes


Index: buffers.c
===================================================================
RCS file: /home/or/cvsroot/src/or/buffers.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- buffers.c	16 Jul 2002 01:12:15 -0000	1.4
+++ buffers.c	16 Jul 2002 02:12:58 -0000	1.5
@@ -79,9 +79,7 @@
 
   /* 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;

Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- connection.c	16 Jul 2002 01:12:15 -0000	1.6
+++ connection.c	16 Jul 2002 02:12:58 -0000	1.7
@@ -180,6 +180,8 @@
   }
   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;
 

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- main.c	16 Jul 2002 01:12:15 -0000	1.10
+++ main.c	16 Jul 2002 02:12:58 -0000	1.11
@@ -38,7 +38,7 @@
 
   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 @@
 
   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 @@
   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 @@
   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;  
 }



More information about the tor-commits mailing list