mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 13:53:31 +01:00
linkpadding is now off by default.
svn:r79
This commit is contained in:
parent
5414786cf1
commit
d8c0d21b49
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#include "or.h"
|
#include "or.h"
|
||||||
|
|
||||||
|
extern or_options_t options; /* command-line and config-file options */
|
||||||
|
|
||||||
int buf_new(char **buf, size_t *buflen, size_t *buf_datalen) {
|
int buf_new(char **buf, size_t *buflen, size_t *buf_datalen) {
|
||||||
|
|
||||||
assert(buf && buflen && buf_datalen);
|
assert(buf && buflen && buf_datalen);
|
||||||
@ -45,6 +47,13 @@ int read_to_buf(int s, int at_most, char **buf, size_t *buflen, size_t *buf_data
|
|||||||
if(at_most == 0)
|
if(at_most == 0)
|
||||||
return 0; /* we shouldn't read anything */
|
return 0; /* we shouldn't read anything */
|
||||||
|
|
||||||
|
if(!options.LinkPadding && at_most > 10*sizeof(cell_t)) {
|
||||||
|
/* if no linkpadding. do a rudimentary round-robin so one
|
||||||
|
* connection can't hog our receiver bucket
|
||||||
|
*/
|
||||||
|
at_most = 10*sizeof(cell_t);
|
||||||
|
}
|
||||||
|
|
||||||
// log(LOG_DEBUG,"read_to_buf(): reading at most %d bytes.",at_most);
|
// log(LOG_DEBUG,"read_to_buf(): reading at most %d bytes.",at_most);
|
||||||
read_result = read(s, *buf+*buf_datalen, at_most);
|
read_result = read(s, *buf+*buf_datalen, at_most);
|
||||||
if (read_result < 0) {
|
if (read_result < 0) {
|
||||||
|
@ -99,7 +99,7 @@ RETURN VALUE: 0 on success, non-zero on error
|
|||||||
options->LogLevel = "debug";
|
options->LogLevel = "debug";
|
||||||
options->loglevel = LOG_DEBUG;
|
options->loglevel = LOG_DEBUG;
|
||||||
options->CoinWeight = 0.8;
|
options->CoinWeight = 0.8;
|
||||||
options->LinkPadding = 1;
|
options->LinkPadding = 0;
|
||||||
options->Role = ROLE_OR_LISTEN | ROLE_OR_CONNECT_ALL | ROLE_OP_LISTEN | ROLE_AP_LISTEN;
|
options->Role = ROLE_OR_LISTEN | ROLE_OR_CONNECT_ALL | ROLE_OP_LISTEN | ROLE_AP_LISTEN;
|
||||||
|
|
||||||
code = poptGetNextOpt(optCon); /* first we handle command-line args */
|
code = poptGetNextOpt(optCon); /* first we handle command-line args */
|
||||||
|
Loading…
Reference in New Issue
Block a user