mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 05:03:43 +01:00
pack into data cells more intelligently
svn:r173
This commit is contained in:
parent
90f8a7a757
commit
fb2f4a0418
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user