diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-07-21 14:01:00 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-07-21 14:01:00 -0400 |
commit | e7e92fb2f9e45c18ac23c90efe2eb32cf3f4a953 (patch) | |
tree | 3177460a8b9e482cea618499ca27a74a5a5c8eef /src | |
parent | a36cd51b59f3fbd99041904ac5b963a296aabefb (diff) | |
parent | fa8bb25f642a4fc57d44951d0192a26dd5a66c5b (diff) | |
download | tor-e7e92fb2f9e45c18ac23c90efe2eb32cf3f4a953.tar.gz tor-e7e92fb2f9e45c18ac23c90efe2eb32cf3f4a953.zip |
Merge remote-tracking branch 'origin/maint-0.2.5'
Diffstat (limited to 'src')
-rw-r--r-- | src/or/channel.c | 7 | ||||
-rw-r--r-- | src/test/test_oom.c | 13 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/or/channel.c b/src/or/channel.c index 1cc786487a..964b3fcac3 100644 --- a/src/or/channel.c +++ b/src/or/channel.c @@ -19,6 +19,7 @@ #include "circuitbuild.h" #include "circuitlist.h" #include "circuitstats.h" +#include "config.h" #include "connection_or.h" /* For var_cell_free() */ #include "circuitmux.h" #include "entrynodes.h" @@ -3277,9 +3278,9 @@ channel_dump_statistics(channel_t *chan, int severity) " is %s, and gives a canonical description of \"%s\" and an " "actual description of \"%s\"", U64_PRINTF_ARG(chan->global_identifier), - remote_addr_str, - channel_get_canonical_remote_descr(chan), - actual); + safe_str(remote_addr_str), + safe_str(channel_get_canonical_remote_descr(chan)), + safe_str(actual)); tor_free(remote_addr_str); tor_free(actual); } else { 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) { |