From 486bd4fae706a1493ee34c3b72d9097d835c6a09 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 18 Jul 2014 21:20:44 +0200 Subject: [PATCH 1/3] Use safe_str in channel_dumpstats: improve 12184 diagnostic --- src/or/channel.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 { From 3af2a5d00efd4e531fb823403b12ab0f6462f9a3 Mon Sep 17 00:00:00 2001 From: Sathyanarayanan Gunasekaran Date: Sun, 20 Jul 2014 16:06:26 -0700 Subject: [PATCH 2/3] Fix warning on building with bufferevents Fixes #11578 --- src/test/test_oom.c | 13 +++++++++++-- 1 file 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) { From fa8bb25f642a4fc57d44951d0192a26dd5a66c5b Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 21 Jul 2014 14:00:10 -0400 Subject: [PATCH 3/3] update changes entry with info for 11578 patch --- changes/bufferevent_compilation | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/changes/bufferevent_compilation b/changes/bufferevent_compilation index 0690e65297..3a328731fe 100644 --- a/changes/bufferevent_compilation +++ b/changes/bufferevent_compilation @@ -1,5 +1,6 @@ o Minor bugfixes: - Fix compilation when building with bufferevents enabled. (This configuration is still not expected to work, however.) - Fixes bugs 12438, 12474; bugfixes on 0.2.5.1-alpha. Patches - from Anthony G. Basile. + Fixes bugs 12438, 12474, 11578; bugfixes on 0.2.5.1-alpha and + 0.2.5.3-alpha. Patches from Anthony G. Basile and Sathyanarayanan + Gunasekaran.