aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/relay.c
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@torproject.org>2018-10-23 21:00:51 +0000
committerGeorge Kadianakis <desnacked@riseup.net>2019-01-02 15:12:23 +0200
commit43701e1ebe169a84fe98480bd0aaa09a9eebede6 (patch)
tree05f9c65801a9b25a10a7ec62681488b0d02d1714 /src/core/or/relay.c
parent4ca1df6b326f32fcc87d7d3fd6294221f6964235 (diff)
downloadtor-43701e1ebe169a84fe98480bd0aaa09a9eebede6.tar.gz
tor-43701e1ebe169a84fe98480bd0aaa09a9eebede6.zip
Circuit padding machine creation events.
These event callbacks allow circuit padding to decide when to attempt to launch and negotiate new padding machines, and when to tear old ones down. Co-authored-by: George Kadianakis <desnacked@riseup.net>
Diffstat (limited to 'src/core/or/relay.c')
-rw-r--r--src/core/or/relay.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/or/relay.c b/src/core/or/relay.c
index 2e92f2a55d..679fc4433d 100644
--- a/src/core/or/relay.c
+++ b/src/core/or/relay.c
@@ -602,7 +602,9 @@ relay_send_command_from_edge_,(streamid_t stream_id, circuit_t *circ,
* one of them. Don't worry about the conn protocol version:
* append_cell_to_circuit_queue will fix it up. */
cell.command = CELL_RELAY_EARLY;
- --origin_circ->remaining_relay_early_cells;
+ /* If we're out of relay early cells, tell circpad */
+ if (--origin_circ->remaining_relay_early_cells == 0)
+ circpad_machine_event_circ_has_no_relay_early(origin_circ);
log_debug(LD_OR, "Sending a RELAY_EARLY cell; %d remaining.",
(int)origin_circ->remaining_relay_early_cells);
/* Memorize the command that is sent as RELAY_EARLY cell; helps debug