[or-cvs] last minute fix: don"t early-flush non-tls streams

Roger Dingledine arma at seul.org
Sat Jan 31 00:36:02 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	connection.c directory.c 
Log Message:
last minute fix: don't early-flush non-tls streams
e.g., this breaks directory service


Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection.c,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -d -r1.148 -r1.149
--- connection.c	20 Jan 2004 09:21:46 -0000	1.148
+++ connection.c	31 Jan 2004 00:36:00 -0000	1.149
@@ -530,8 +530,8 @@
  * push data out as soon as we know there's enough for a tls record, so
  * during periods of high load we won't read the entire megabyte from
  * input before pushing any data out. */
-/* We follow the same algorithm for non-tls streams, because hey, why not. */
-  if(conn->outbuf_flushlen < MIN_TLS_FLUSHLEN &&
+  if(connection_speaks_cells(conn) &&
+     conn->outbuf_flushlen < MIN_TLS_FLUSHLEN &&
      conn->outbuf_flushlen+len >= MIN_TLS_FLUSHLEN) {
     len -= (MIN_TLS_FLUSHLEN - conn->outbuf_flushlen);
     conn->outbuf_flushlen = MIN_TLS_FLUSHLEN;

Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/src/or/directory.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- directory.c	17 Dec 2003 21:09:31 -0000	1.56
+++ directory.c	31 Jan 2004 00:36:00 -0000	1.57
@@ -261,7 +261,7 @@
       log_fn(LOG_INFO,"Finished writing server response. Closing.");
       return -1; /* kill it */
     default:
-      log_fn(LOG_WARN,"BUG: called in unexpected state.");
+      log_fn(LOG_WARN,"BUG: called in unexpected state %d.", conn->state);
       return -1;
   }
   return 0;



More information about the tor-commits mailing list