aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-10-14 03:06:48 +0000
committerRoger Dingledine <arma@torproject.org>2003-10-14 03:06:48 +0000
commit58ec05877a4f07dfc1680a26eeda91e6f81bf717 (patch)
tree0344d91fc4242ba02193a078016c6f9f354b2e1b /src/or/connection.c
parentee9e54b43464d3792d000294dab264420e9784c5 (diff)
downloadtor-58ec05877a4f07dfc1680a26eeda91e6f81bf717.tar
tor-58ec05877a4f07dfc1680a26eeda91e6f81bf717.tar.gz
make the buffer resize stuff work
and make listener connections not have bufs svn:r584
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index dcdb474a1..7a0d0b8b6 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -80,8 +80,10 @@ connection_t *connection_new(int type) {
memset(conn,0,sizeof(connection_t)); /* zero it out to start */
conn->type = type;
- conn->inbuf = buf_new();
- conn->outbuf = buf_new();
+ if(!connection_is_listener(conn)) { /* listeners never use their buf */
+ conn->inbuf = buf_new();
+ conn->outbuf = buf_new();
+ }
conn->timestamp_created = now;
conn->timestamp_lastread = now;
@@ -93,8 +95,10 @@ connection_t *connection_new(int type) {
void connection_free(connection_t *conn) {
assert(conn);
- buf_free(conn->inbuf);
- buf_free(conn->outbuf);
+ if(!connection_is_listener(conn)) {
+ buf_free(conn->inbuf);
+ buf_free(conn->outbuf);
+ }
if(conn->address)
free(conn->address);