diff options
author | David Goulet <dgoulet@torproject.org> | 2022-02-03 21:18:52 +0000 |
---|---|---|
committer | Mike Perry <mikeperry-git@torproject.org> | 2022-02-22 19:28:35 +0000 |
commit | 6f45ad3771880b9f03bcc0190dce4959df211005 (patch) | |
tree | 1d8796e8a5603a420a22bc5607d5dc1d64c7c965 /src/feature/hs/hs_circuit.c | |
parent | 729dd14fdec9ece47142a5dc1434d32da109982e (diff) | |
download | tor-6f45ad3771880b9f03bcc0190dce4959df211005.tar.gz tor-6f45ad3771880b9f03bcc0190dce4959df211005.zip |
hs: Setup congestion control on service rends using intro data
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_circuit.c')
-rw-r--r-- | src/feature/hs/hs_circuit.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/feature/hs/hs_circuit.c b/src/feature/hs/hs_circuit.c index 10a6f51eb3..f2953cfb02 100644 --- a/src/feature/hs/hs_circuit.c +++ b/src/feature/hs/hs_circuit.c @@ -17,6 +17,8 @@ #include "core/or/relay.h" #include "core/or/crypt_path.h" #include "core/or/extendinfo.h" +#include "core/or/congestion_control_common.h" +#include "core/crypto/onion_crypto.h" #include "feature/client/circpathbias.h" #include "feature/hs/hs_cell.h" #include "feature/hs/hs_circuit.h" @@ -408,6 +410,14 @@ launch_rendezvous_point_circuit,(const hs_service_t *service, tor_assert(circ->hs_ident); } + if (data->cc_enabled) { + circuit_params_t circ_params = { + .cc_enabled = data->cc_enabled, + .sendme_inc_cells = congestion_control_sendme_inc(), + }; + TO_CIRCUIT(circ)->ccontrol = congestion_control_new(&circ_params); + } + end: extend_info_free(info); } @@ -504,6 +514,14 @@ retry_service_rendezvous_point(const origin_circuit_t *circ) new_circ->build_state->expiry_time = bstate->expiry_time; new_circ->hs_ident = hs_ident_circuit_dup(circ->hs_ident); + if (TO_CIRCUIT(circ)->ccontrol != NULL) { + circuit_params_t circ_params = { + .cc_enabled = 1, + .sendme_inc_cells = TO_CIRCUIT(circ)->ccontrol->sendme_inc, + }; + TO_CIRCUIT(new_circ)->ccontrol = congestion_control_new(&circ_params); + } + done: return; } |