aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-03-10 22:40:02 +0000
committerRoger Dingledine <arma@torproject.org>2003-03-10 22:40:02 +0000
commitfb2f4a0418d1bf16d28a14b4dc80c417e61917e8 (patch)
tree65fedcee9139df08d1b82f234a568ceddbce8fe2 /src/or
parent90f8a7a757002bb21f40f48653d37484662dcf90 (diff)
downloadtor-fb2f4a0418d1bf16d28a14b4dc80c417e61917e8.tar
tor-fb2f4a0418d1bf16d28a14b4dc80c417e61917e8.tar.gz
pack into data cells more intelligently
svn:r173
Diffstat (limited to 'src/or')
-rw-r--r--src/or/buffers.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index 5bdc8e73e..424e2fe9e 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -52,9 +52,14 @@ int read_to_buf(int s, int at_most, char **buf, int *buflen, int *buf_datalen, i
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);