[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[or-cvs] pack into data cells more intelligently



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

Modified Files:
	buffers.c 
Log Message:
pack into data cells more intelligently


Index: buffers.c
===================================================================
RCS file: /home/or/cvsroot/src/or/buffers.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- buffers.c	4 Mar 2003 04:36:37 -0000	1.11
+++ buffers.c	10 Mar 2003 22:40:02 -0000	1.12
@@ -52,9 +52,14 @@
 
   if(!options.LinkPadding && at_most > 10*sizeof(cell_t)) {
     /* if no linkpadding: do a rudimentary round-robin so one
-     * connection can't hog an outgoing connection
+     * connection can't hog a thickpipe
+     */
+    at_most = 10*(CELL_PAYLOAD_SIZE - TOPIC_HEADER_SIZE);
+    /* XXX this still isn't perfect. now we read 10 data payloads per read --
+     * but if we're reading from a connection that speaks cells, we always
+     * read a partial cell from the network and can't process it yet. Good
+     * enough for now though. (And maybe best, to stress our code more.)
      */
-    at_most = 10*sizeof(cell_t); /* FIXME should be 10* size of usable payload */
   }
 
 //  log(LOG_DEBUG,"read_to_buf(): reading at most %d bytes.",at_most);