diff options
author | Sathyanarayanan Gunasekaran <gsathya.ceg@gmail.com> | 2014-07-20 16:06:26 -0700 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-07-21 13:58:14 -0400 |
commit | 3af2a5d00efd4e531fb823403b12ab0f6462f9a3 (patch) | |
tree | cd935422b7813d2901fae22e128cecabbd83997e /src/test/test_oom.c | |
parent | 486bd4fae706a1493ee34c3b72d9097d835c6a09 (diff) | |
download | tor-3af2a5d00efd4e531fb823403b12ab0f6462f9a3.tar.gz tor-3af2a5d00efd4e531fb823403b12ab0f6462f9a3.zip |
Fix warning on building with bufferevents
Fixes #11578
Diffstat (limited to 'src/test/test_oom.c')
-rw-r--r-- | src/test/test_oom.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/test/test_oom.c b/src/test/test_oom.c index 32f4803bba..2726056b80 100644 --- a/src/test/test_oom.c +++ b/src/test/test_oom.c @@ -97,16 +97,25 @@ dummy_edge_conn_new(circuit_t *circ, int type, size_t in_bytes, size_t out_bytes) { edge_connection_t *conn; + generic_buffer_t *inbuf, *outbuf; if (type == CONN_TYPE_EXIT) conn = edge_connection_new(type, AF_INET); else conn = ENTRY_TO_EDGE_CONN(entry_connection_new(type, AF_INET)); +#ifdef USE_BUFFEREVENTS + inbuf = bufferevent_get_input(TO_CONN(conn)->bufev); + outbuf = bufferevent_get_output(TO_CONN(conn)->bufev); +#else + inbuf = TO_CONN(conn)->inbuf; + outbuf = TO_CONN(conn)->outbuf; +#endif + /* We add these bytes directly to the buffers, to avoid all the * edge connection read/write machinery. */ - add_bytes_to_buf(TO_CONN(conn)->inbuf, in_bytes); - add_bytes_to_buf(TO_CONN(conn)->outbuf, out_bytes); + add_bytes_to_buf(inbuf, in_bytes); + add_bytes_to_buf(outbuf, out_bytes); conn->on_circuit = circ; if (type == CONN_TYPE_EXIT) { |