aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-08-09 11:40:28 -0700
committerNick Mathewson <nickm@torproject.org>2010-09-27 12:31:13 -0400
commitddcb59bb70457e203247931aaad3a3ff8b923f97 (patch)
tree803eac2d836936d44043b7793f4e6706208504cd /src/or/connection_or.c
parent5279036148ca158f7c60f793f401604060b1c1ba (diff)
downloadtor-ddcb59bb70457e203247931aaad3a3ff8b923f97.tar.gz
tor-ddcb59bb70457e203247931aaad3a3ff8b923f97.zip
Fix more remaining users of inbuf/outbuf to handle bufferevents instead.
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 169f14153a..a2eb868d95 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -1253,12 +1253,18 @@ connection_or_write_var_cell_to_buf(const var_cell_t *cell,
conn->timestamp_last_added_nonpadding = approx_time();
}
-/** See whether there's a variable-length cell waiting on <b>conn</b>'s
+/** See whether there's a variable-length cell waiting on <b>or_conn</b>'s
* inbuf. Return values as for fetch_var_cell_from_buf(). */
static int
-connection_fetch_var_cell_from_buf(or_connection_t *conn, var_cell_t **out)
+connection_fetch_var_cell_from_buf(or_connection_t *or_conn, var_cell_t **out)
{
- return fetch_var_cell_from_buf(conn->_base.inbuf, out, conn->link_proto);
+ connection_t *conn = TO_CONN(or_conn);
+ IF_HAS_BUFFEREVENT(conn, {
+ struct evbuffer *input = bufferevent_get_input(conn->bufev);
+ return fetch_var_cell_from_evbuffer(input, out, or_conn->link_proto);
+ }) ELSE_IF_NO_BUFFEREVENT {
+ return fetch_var_cell_from_buf(conn->inbuf, out, or_conn->link_proto);
+ }
}
/** Process cells from <b>conn</b>'s inbuf.