summaryrefslogtreecommitdiff
path: root/src/or/connection.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-08-11 15:16:16 -0400
committerNick Mathewson <nickm@torproject.org>2010-09-27 12:31:13 -0400
commit4af6887d201d978a46072ead0036e0d16fa5908a (patch)
tree6d4c6d53f20ac02ef713fd01a211a57ff26c6510 /src/or/connection.h
parentb63f6518cbdc4c80b09399bc17d3bec3cac76ad9 (diff)
downloadtor-4af6887d201d978a46072ead0036e0d16fa5908a.tar.gz
tor-4af6887d201d978a46072ead0036e0d16fa5908a.zip
Add support for linked connections with bufferevent_pair.
Also, set directory connections (linked and otherwise) to use bufferevents. Also, stop using outbuf_flushlen anywhere except for OR connections.
Diffstat (limited to 'src/or/connection.h')
-rw-r--r--src/or/connection.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/connection.h b/src/or/connection.h
index 4d269d649a..adf79f1391 100644
--- a/src/or/connection.h
+++ b/src/or/connection.h
@@ -100,7 +100,7 @@ connection_get_inbuf_len(connection_t *conn)
IF_HAS_BUFFEREVENT(conn, {
return evbuffer_get_length(bufferevent_get_input(conn->bufev));
}) ELSE_IF_NO_BUFFEREVENT {
- return buf_datalen(conn->inbuf);
+ return conn->inbuf ? buf_datalen(conn->inbuf) : 0;
}
}
@@ -110,7 +110,7 @@ connection_get_outbuf_len(connection_t *conn)
IF_HAS_BUFFEREVENT(conn, {
return evbuffer_get_length(bufferevent_get_output(conn->bufev));
}) ELSE_IF_NO_BUFFEREVENT {
- return buf_datalen(conn->outbuf);
+ return conn->outbuf ? buf_datalen(conn->outbuf) : 0;
}
}