aboutsummaryrefslogtreecommitdiff
path: root/src/or/test.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-10-21 08:37:07 +0000
committerRoger Dingledine <arma@torproject.org>2003-10-21 08:37:07 +0000
commit4a66865d0be89445e70230548e7cf2a1cbd59db5 (patch)
tree48f8d1fbd755c03d97023f4a50d8095e919515cd /src/or/test.c
parentf8a72b1c217c182f41a71122eb5e01bc5d0e7f77 (diff)
downloadtor-4a66865d0be89445e70230548e7cf2a1cbd59db5.tar.gz
tor-4a66865d0be89445e70230548e7cf2a1cbd59db5.zip
send the end cell when we realize we're going to end,
not when we're closing the stream. this lets us put a payload in the end cell if we want to, to describe why we're closing the stream. there are still some places where we don't send the end cell immediately. i need to track them down. but it's a low priority, since i've made it send the end cell when we close the stream if we haven't already sent it. svn:r640
Diffstat (limited to 'src/or/test.c')
-rw-r--r--src/or/test.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/or/test.c b/src/or/test.c
index 269022b5b3..7d692c1f35 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -46,7 +46,7 @@ setup_directory() {
void
test_buffers() {
-#define MAX_BUF_SIZE 640*1024
+#define MAX_BUF_SIZE 1024*1024
char str[256];
char str2[256];
@@ -61,7 +61,7 @@ test_buffers() {
if (!(buf = buf_new()))
test_fail();
- test_eq(buf_capacity(buf), 2*1024);
+ test_eq(buf_capacity(buf), 512*1024);
test_eq(buf_datalen(buf), 0);
/****
@@ -77,7 +77,7 @@ test_buffers() {
s = open("/tmp/tor_test/data", O_RDONLY, 0);
eof = 0;
i = read_to_buf(s, 10, buf, &eof);
- test_eq(buf_capacity(buf), 2*1024);
+ test_eq(buf_capacity(buf), 512*1024);
test_eq(buf_datalen(buf), 10);
test_eq(eof, 0);
test_eq(i, 10);
@@ -85,7 +85,7 @@ test_buffers() {
/* Test reading 0 bytes. */
i = read_to_buf(s, 0, buf, &eof);
- test_eq(buf_capacity(buf), MAX_BUF_SIZE);
+ test_eq(buf_capacity(buf), 512*1024);
test_eq(buf_datalen(buf), 10);
test_eq(eof, 0);
test_eq(i, 0);
@@ -103,7 +103,7 @@ test_buffers() {
/* Now test when buffer is filled with more data to read. */
buf2 = buf_new_with_capacity(32);
i = read_to_buf(s, 128, buf2, &eof);
- test_eq(buf_capacity(buf2), 32);
+ test_eq(buf_capacity(buf2), 128);
test_eq(buf_datalen(buf2), 32);
test_eq(eof, 0);
test_eq(i, 32);