From: Nick Mathewson Date: Tue, 18 Jun 2013 14:25:30 +0000 (-0400) Subject: Merge remote-tracking branch 'origin/maint-0.2.4' X-Git-Tag: tor-0.2.5.1-alpha~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5d1fded3dfa836ef1f45f6acb74971f75d5caa9;p=thirdparty%2Ftor.git Merge remote-tracking branch 'origin/maint-0.2.4' --- b5d1fded3dfa836ef1f45f6acb74971f75d5caa9 diff --cc src/or/circuitlist.h index 94887d5faf,874f68cd22..03f678c5af --- a/src/or/circuitlist.h +++ b/src/or/circuitlist.h @@@ -63,9 -61,7 +63,10 @@@ int circuit_count_pending_on_channel(ch void assert_cpath_layer_ok(const crypt_path_t *cp); void assert_circuit_ok(const circuit_t *c); void circuit_free_all(void); + void circuits_handle_oom(size_t current_allocation); +void channel_note_destroy_pending(channel_t *chan, circid_t id); +void channel_note_destroy_not_pending(channel_t *chan, circid_t id); + #endif diff --cc src/or/relay.c index 38776bcd9a,3138c5e8d1..251d3ffa2f --- a/src/or/relay.c +++ b/src/or/relay.c @@@ -2597,8 -2534,14 +2620,14 @@@ append_cell_to_circuit_queue(circuit_t } #endif - cell_queue_append_packed_copy(queue, cell, chan->wide_circ_ids); + cell_queue_append_packed_copy(queue, cell, chan->wide_circ_ids, 1); + if (PREDICT_UNLIKELY(cell_queues_check_size())) { + /* We ran the OOM handler */ + if (circ->marked_for_close) + return; + } + /* If we have too many cells on the circuit, we should stop reading from * the edge streams for a while. */ if (!streams_blocked && queue->n >= CELL_QUEUE_HIGHWATER_SIZE)