Skip to content
Snippets Groups Projects
Commit 3af2a5d0 authored by Sathyanarayanan Gunasekaran's avatar Sathyanarayanan Gunasekaran Committed by Nick Mathewson
Browse files

Fix warning on building with bufferevents

Fixes #11578
parent 486bd4fa
No related branches found
No related tags found
No related merge requests found
...@@ -97,16 +97,25 @@ dummy_edge_conn_new(circuit_t *circ, ...@@ -97,16 +97,25 @@ dummy_edge_conn_new(circuit_t *circ,
int type, size_t in_bytes, size_t out_bytes) int type, size_t in_bytes, size_t out_bytes)
{ {
edge_connection_t *conn; edge_connection_t *conn;
generic_buffer_t *inbuf, *outbuf;
if (type == CONN_TYPE_EXIT) if (type == CONN_TYPE_EXIT)
conn = edge_connection_new(type, AF_INET); conn = edge_connection_new(type, AF_INET);
else else
conn = ENTRY_TO_EDGE_CONN(entry_connection_new(type, AF_INET)); 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 /* We add these bytes directly to the buffers, to avoid all the
* edge connection read/write machinery. */ * edge connection read/write machinery. */
add_bytes_to_buf(TO_CONN(conn)->inbuf, in_bytes); add_bytes_to_buf(inbuf, in_bytes);
add_bytes_to_buf(TO_CONN(conn)->outbuf, out_bytes); add_bytes_to_buf(outbuf, out_bytes);
conn->on_circuit = circ; conn->on_circuit = circ;
if (type == CONN_TYPE_EXIT) { if (type == CONN_TYPE_EXIT) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment