diff options
author | Mike Perry <mikeperry-git@torproject.org> | 2022-02-03 12:01:23 +0000 |
---|---|---|
committer | Mike Perry <mikeperry-git@torproject.org> | 2022-02-22 19:28:35 +0000 |
commit | b2553bfba28b2e26f09041a3d78fa39c35fd4ac8 (patch) | |
tree | 896677eaf525afbe5decee7c628b5d73b6e5a7b8 /src/feature/hs | |
parent | 0a6cde8756423336c8e6901b55c31d67a2a35245 (diff) | |
download | tor-b2553bfba28b2e26f09041a3d78fa39c35fd4ac8.tar.gz tor-b2553bfba28b2e26f09041a3d78fa39c35fd4ac8.zip |
Use path type hint for Vegas queue parameters.
These parameters will vary depending on path length, especially for onions.
Diffstat (limited to 'src/feature/hs')
-rw-r--r-- | src/feature/hs/hs_circuit.c | 26 | ||||
-rw-r--r-- | src/feature/hs/hs_client.c | 14 |
2 files changed, 37 insertions, 3 deletions
diff --git a/src/feature/hs/hs_circuit.c b/src/feature/hs/hs_circuit.c index f2953cfb02..271bf652e7 100644 --- a/src/feature/hs/hs_circuit.c +++ b/src/feature/hs/hs_circuit.c @@ -415,7 +415,20 @@ launch_rendezvous_point_circuit,(const hs_service_t *service, .cc_enabled = data->cc_enabled, .sendme_inc_cells = congestion_control_sendme_inc(), }; - TO_CIRCUIT(circ)->ccontrol = congestion_control_new(&circ_params); + + /* Initialize ccontrol for appropriate path type */ + if (service->config.is_single_onion) { + TO_CIRCUIT(circ)->ccontrol = congestion_control_new(&circ_params, + CC_PATH_ONION_SOS); + } else { + if (get_options()->HSLayer3Nodes) { + TO_CIRCUIT(circ)->ccontrol = congestion_control_new(&circ_params, + CC_PATH_ONION_VG); + } else { + TO_CIRCUIT(circ)->ccontrol = congestion_control_new(&circ_params, + CC_PATH_ONION); + } + } } end: @@ -519,7 +532,16 @@ retry_service_rendezvous_point(const origin_circuit_t *circ) .cc_enabled = 1, .sendme_inc_cells = TO_CIRCUIT(circ)->ccontrol->sendme_inc, }; - TO_CIRCUIT(new_circ)->ccontrol = congestion_control_new(&circ_params); + + /* As per above, in this case, we are a full 3 hop rend, even if we're a + * single-onion service */ + if (get_options()->HSLayer3Nodes) { + TO_CIRCUIT(new_circ)->ccontrol = congestion_control_new(&circ_params, + CC_PATH_ONION_VG); + } else { + TO_CIRCUIT(new_circ)->ccontrol = congestion_control_new(&circ_params, + CC_PATH_ONION_SOS); + } } done: diff --git a/src/feature/hs/hs_client.c b/src/feature/hs/hs_client.c index 69b071e197..81c0459a86 100644 --- a/src/feature/hs/hs_client.c +++ b/src/feature/hs/hs_client.c @@ -788,7 +788,19 @@ setup_rendezvous_circ_congestion_control(origin_circuit_t *circ) circ_params.cc_enabled = congestion_control_enabled(); if (circ_params.cc_enabled) { circ_params.sendme_inc_cells = desc->encrypted_data.sendme_inc; - TO_CIRCUIT(circ)->ccontrol = congestion_control_new(&circ_params); + + if (desc->encrypted_data.single_onion_service) { + TO_CIRCUIT(circ)->ccontrol = congestion_control_new(&circ_params, + CC_PATH_ONION_SOS); + } else { + if (get_options()->HSLayer3Nodes) { + TO_CIRCUIT(circ)->ccontrol = congestion_control_new(&circ_params, + CC_PATH_ONION_VG); + } else { + TO_CIRCUIT(circ)->ccontrol = congestion_control_new(&circ_params, + CC_PATH_ONION); + } + } } } |