From: Nick Mathewson Date: Thu, 14 Aug 2014 03:14:28 +0000 (-0400) Subject: Merge remote-tracking branch 'public/bug12848_024' into maint-0.2.5 X-Git-Tag: tor-0.2.6.1-alpha~206^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d443658fade3b4090d0b93903b4aec857cab03ea;p=thirdparty%2Ftor.git Merge remote-tracking branch 'public/bug12848_024' into maint-0.2.5 Conflicts: src/or/circuitbuild.c --- d443658fade3b4090d0b93903b4aec857cab03ea diff --cc src/or/channel.c index 3072effc8f,cd55bd0dfd..ffd68493d0 --- a/src/or/channel.c +++ b/src/or/channel.c @@@ -2681,7 -2622,17 +2681,15 @@@ is_destroy_cell(channel_t *chan int channel_send_destroy(circid_t circ_id, channel_t *chan, int reason) { - cell_t cell; - tor_assert(chan); + if (circ_id == 0) { + log_warn(LD_BUG, "Attempted to send a destroy cell for circID 0 " + "on a channel " U64_FORMAT " at %p in state %s (%d)", + U64_PRINTF_ARG(chan->global_identifier), + chan, channel_state_to_string(chan->state), + chan->state); + return 0; + } /* Check to make sure we can send on this channel first */ if (!(chan->state == CHANNEL_STATE_CLOSING || diff --cc src/or/circuitbuild.c index 283afee31f,5325eff64a..897f90fe4c --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@@ -657,13 -584,9 +658,11 @@@ circuit_deliver_create_cell(circuit_t * id = get_unique_circ_id_by_chan(circ->n_chan); if (!id) { - log_warn(LD_CIRC,"failed to get unique circID."); + static ratelim_t circid_warning_limit = RATELIM_INIT(9600); + log_fn_ratelim(&circid_warning_limit, LOG_WARN, LD_CIRC, + "failed to get unique circID."); - return -1; + goto error; } - log_debug(LD_CIRC,"Chosen circID %u.", (unsigned)id); - circuit_set_n_circid_chan(circ, id, circ->n_chan); memset(&cell, 0, sizeof(cell_t)); r = relayed ? create_cell_format_relayed(&cell, create_cell)