diff options
author | Roger Dingledine <arma@torproject.org> | 2005-04-07 22:13:17 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-04-07 22:13:17 +0000 |
commit | 97637549bb7ec6e26a49e6783a5675849482546b (patch) | |
tree | 1640adb96d77ba70e2677eb7730e4f280fbb28c9 /src | |
parent | dabafddb82205c7f8de022699f9703fa13111ecc (diff) | |
download | tor-97637549bb7ec6e26a49e6783a5675849482546b.tar.gz tor-97637549bb7ec6e26a49e6783a5675849482546b.zip |
tie MAX_DIR_SIZE to MAX_BUF_SIZE
resolve bug 80
svn:r4052
Diffstat (limited to 'src')
-rw-r--r-- | src/or/buffers.c | 2 | ||||
-rw-r--r-- | src/or/or.h | 4 | ||||
-rw-r--r-- | src/or/test.c | 1 |
3 files changed, 3 insertions, 4 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c index 2a4342e3ef..fe6b8d739d 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -22,8 +22,6 @@ struct buf_t { /** Size, in bytes, for newly allocated buffers. Should be a power of 2. */ #define INITIAL_BUF_SIZE (4*1024) -/** Maximum size, in bytes, for resized buffers. */ -#define MAX_BUF_SIZE (1024*1024*10) /** Size, in bytes, for minimum 'shrink' size for buffers. Buffers may start * out smaller than this, but they will never autoshrink to less * than this size. */ diff --git a/src/or/or.h b/src/or/or.h index 0eee10681b..5f7c2823a2 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -154,7 +154,9 @@ #define MAX_NICKNAME_LEN 19 /* Hex digest plus dollar sign. */ #define MAX_HEX_NICKNAME_LEN (HEX_DIGEST_LEN+1) -#define MAX_DIR_SIZE 500000 +/** Maximum size, in bytes, for resized buffers. */ +#define MAX_BUF_SIZE ((1<<24)-1) +#define MAX_DIR_SIZE MAX_BUF_SIZE /* For http parsing */ #define MAX_HEADERS_SIZE 50000 diff --git a/src/or/test.c b/src/or/test.c index 822c56b430..0e1c473010 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -118,7 +118,6 @@ remove_directory(void) static void test_buffers(void) { -#define MAX_BUF_SIZE 1024*1024 char str[256]; char str2[256]; |