summaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_client.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2022-03-16 11:01:56 -0400
committerDavid Goulet <dgoulet@torproject.org>2022-03-16 14:03:27 -0400
commitdd63e8cf9dd12677ba1396f3b8f697718538d9bf (patch)
tree5afe0054ccea3ee6b795e08b72006866736745da /src/feature/hs/hs_client.c
parent7ce17c2b008dee04b209ac698e7a380eae63987e (diff)
downloadtor-dd63e8cf9dd12677ba1396f3b8f697718538d9bf.tar.gz
tor-dd63e8cf9dd12677ba1396f3b8f697718538d9bf.zip
hs: Transfer ccontrol from circuit to cpath
Once the cpath is finalized, e2e encryption setup, transfer the ccontrol from the rendezvous circuit to the cpath. This allows the congestion control subsystem to properly function for both upload and download side of onion services. Closes #40586 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_client.c')
-rw-r--r--src/feature/hs/hs_client.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/feature/hs/hs_client.c b/src/feature/hs/hs_client.c
index eb68adfd76..c845a5a945 100644
--- a/src/feature/hs/hs_client.c
+++ b/src/feature/hs/hs_client.c
@@ -826,6 +826,11 @@ setup_rendezvous_circ_congestion_control(origin_circuit_t *circ)
if (circ_params.cc_enabled) {
circ_params.sendme_inc_cells = desc->encrypted_data.sendme_inc;
+ /* It is setup on the circuit in order to indicate that congestion control
+ * is enabled. It will be transferred to the RP crypt_path_t once the
+ * handshake is finalized in finalize_rend_circuit() because the final hop
+ * is not available until then. */
+
if (desc->encrypted_data.single_onion_service) {
TO_CIRCUIT(circ)->ccontrol = congestion_control_new(&circ_params,
CC_PATH_ONION_SOS);