mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Merge branch 'tor-gitlab/mr/668'
This commit is contained in:
commit
1e6d839ce9
@ -76,7 +76,7 @@ Steps are:
|
|||||||
|
|
||||||
1. Run `./build.sh` which will download everything you need, including the
|
1. Run `./build.sh` which will download everything you need, including the
|
||||||
latest tarballs from the release CI, and auto-commit the signatures if
|
latest tarballs from the release CI, and auto-commit the signatures if
|
||||||
the checksum match. You will need to confim the commits.
|
the checksum match. You will need to confirm the commits.
|
||||||
|
|
||||||
2. If all is good, `git push origin main` your signatures.
|
2. If all is good, `git push origin main` your signatures.
|
||||||
|
|
||||||
|
@ -336,7 +336,7 @@ glass-box one is one you implement while looking at how the function is
|
|||||||
implemented.
|
implemented.
|
||||||
|
|
||||||
In either case, make sure to consider common cases *and* edge cases; success
|
In either case, make sure to consider common cases *and* edge cases; success
|
||||||
cases and failure csaes.
|
cases and failure cases.
|
||||||
|
|
||||||
For example, consider testing this function:
|
For example, consider testing this function:
|
||||||
|
|
||||||
|
@ -7256,7 +7256,7 @@ getinfo_helper_config(control_connection_t *conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check whether an address has already been set against the options
|
/* Check whether an address has already been set against the options
|
||||||
* depending on address family and destination type. Any exsting
|
* depending on address family and destination type. Any existing
|
||||||
* value will lead to a fail, even if it is the same value. If not
|
* value will lead to a fail, even if it is the same value. If not
|
||||||
* set and not only validating, copy it into this location too.
|
* set and not only validating, copy it into this location too.
|
||||||
* Returns 0 on success or -1 if this address is already set.
|
* Returns 0 on success or -1 if this address is already set.
|
||||||
|
@ -810,7 +810,7 @@ find_my_address(const or_options_t *options, int family, int warn_severity,
|
|||||||
* want to learn here if the address is considered to come from the
|
* want to learn here if the address is considered to come from the
|
||||||
* Internet basically.
|
* Internet basically.
|
||||||
*
|
*
|
||||||
* @param addr The address to test if local and also test against our resovled
|
* @param addr The address to test if local and also test against our resolved
|
||||||
* address.
|
* address.
|
||||||
*
|
*
|
||||||
* @return True iff address is considered local or else False.
|
* @return True iff address is considered local or else False.
|
||||||
|
@ -127,7 +127,7 @@ static uint8_t n_ewma_ss;
|
|||||||
static uint8_t bwe_sendme_min;
|
static uint8_t bwe_sendme_min;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Percentage of the current RTT to use when reseting the minimum RTT
|
* Percentage of the current RTT to use when resetting the minimum RTT
|
||||||
* for a circuit. (RTT is reset when the cwnd hits cwnd_min).
|
* for a circuit. (RTT is reset when the cwnd hits cwnd_min).
|
||||||
*/
|
*/
|
||||||
static uint8_t rtt_reset_pct;
|
static uint8_t rtt_reset_pct;
|
||||||
|
@ -41,8 +41,8 @@ typedef enum {
|
|||||||
* Prop#324: TOR_NOLA - NOLA looks the BDP right in the eye and uses it
|
* Prop#324: TOR_NOLA - NOLA looks the BDP right in the eye and uses it
|
||||||
* immediately as CWND. No slow start, no other congestion signals, no delay,
|
* immediately as CWND. No slow start, no other congestion signals, no delay,
|
||||||
* no bullshit. Like TOR_VEGAS, it also uses aggressive BDP estimates, to
|
* no bullshit. Like TOR_VEGAS, it also uses aggressive BDP estimates, to
|
||||||
* avoid out-competition. It seems a bit better throughput than Vegas,
|
* avoid out-competition. It seems a bit better throughput than Vegas, but
|
||||||
* but its agressive BDP and rapid updates may lead to more queue latency. */
|
* its aggressive BDP and rapid updates may lead to more queue latency. */
|
||||||
CC_ALG_NOLA = 3,
|
CC_ALG_NOLA = 3,
|
||||||
} cc_alg_t;
|
} cc_alg_t;
|
||||||
|
|
||||||
|
@ -354,12 +354,12 @@ congestion_control_vegas_process_sendme(congestion_control_t *cc,
|
|||||||
0);
|
0);
|
||||||
} else {
|
} else {
|
||||||
cc->cwnd += inc;
|
cc->cwnd += inc;
|
||||||
cc->next_cc_event = 1; // Technically irellevant, but for consistency
|
cc->next_cc_event = 1; // Technically irrelevant, but for consistency
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uint64_t old_cwnd = cc->cwnd;
|
uint64_t old_cwnd = cc->cwnd;
|
||||||
|
|
||||||
/* Congestion signal: Set cwnd to gamma threshhold */
|
/* Congestion signal: Set cwnd to gamma threshold */
|
||||||
cc->cwnd = vegas_bdp(cc) + cc->vegas_params.gamma;
|
cc->cwnd = vegas_bdp(cc) + cc->vegas_params.gamma;
|
||||||
|
|
||||||
/* Compute the percentage we experience a blocked csig vs RTT sig */
|
/* Compute the percentage we experience a blocked csig vs RTT sig */
|
||||||
@ -398,8 +398,8 @@ congestion_control_vegas_process_sendme(congestion_control_t *cc,
|
|||||||
uint64_t old_cwnd = cc->cwnd;
|
uint64_t old_cwnd = cc->cwnd;
|
||||||
uint64_t cwnd_diff;
|
uint64_t cwnd_diff;
|
||||||
|
|
||||||
/* If we are above the delta threshhold, drop cwnd down to the
|
/* If we are above the delta threshold, drop cwnd down to the
|
||||||
* delta threshhold. */
|
* delta threshold. */
|
||||||
cc->cwnd = vegas_bdp(cc) + cc->vegas_params.delta - CWND_INC(cc);
|
cc->cwnd = vegas_bdp(cc) + cc->vegas_params.delta - CWND_INC(cc);
|
||||||
|
|
||||||
/* Account the amount we reduced the cwnd by for the gamma cutoff */
|
/* Account the amount we reduced the cwnd by for the gamma cutoff */
|
||||||
|
@ -88,7 +88,7 @@ struct connection_t {
|
|||||||
* connection. */
|
* connection. */
|
||||||
unsigned int linked_conn_is_closed:1;
|
unsigned int linked_conn_is_closed:1;
|
||||||
/** True iff this connection was opened from a listener and thus we've
|
/** True iff this connection was opened from a listener and thus we've
|
||||||
* recevied this connection. Else, it means we've initiated an outbound
|
* received this connection. Else, it means we've initiated an outbound
|
||||||
* connection. */
|
* connection. */
|
||||||
unsigned int from_listener:1;
|
unsigned int from_listener:1;
|
||||||
|
|
||||||
|
@ -3051,7 +3051,7 @@ channel_flush_from_first_active_circuit, (channel_t *chan, int max))
|
|||||||
*
|
*
|
||||||
* We are accepting this as an "ok" race else the changes are likely non
|
* We are accepting this as an "ok" race else the changes are likely non
|
||||||
* trivial to make the mark for close to set the num cells to 0 and change
|
* trivial to make the mark for close to set the num cells to 0 and change
|
||||||
* the free functions to detach the circuit conditionnaly without creating
|
* the free functions to detach the circuit conditionally without creating
|
||||||
* a chain effect of madness.
|
* a chain effect of madness.
|
||||||
*
|
*
|
||||||
* The lesson here is arti will prevail and leave the cmux dragon alone. */
|
* The lesson here is arti will prevail and leave the cmux dragon alone. */
|
||||||
@ -3150,7 +3150,7 @@ channel_flush_from_first_active_circuit, (channel_t *chan, int max))
|
|||||||
/* Minimum value is the maximum circuit window size.
|
/* Minimum value is the maximum circuit window size.
|
||||||
*
|
*
|
||||||
* This value is set to a lower bound we believe is reasonable with congestion
|
* This value is set to a lower bound we believe is reasonable with congestion
|
||||||
* control and basic network tunning parameters.
|
* control and basic network running parameters.
|
||||||
*
|
*
|
||||||
* SENDME cells makes it that we can control how many cells can be inflight on
|
* SENDME cells makes it that we can control how many cells can be inflight on
|
||||||
* a circuit from end to end. This logic makes it that on any circuit cell
|
* a circuit from end to end. This logic makes it that on any circuit cell
|
||||||
|
@ -351,7 +351,7 @@ circuit_sendme_cell_is_next(int deliver_window, int sendme_inc)
|
|||||||
*
|
*
|
||||||
* Because deliver_window starts at CIRCWINDOW_START and counts down,
|
* Because deliver_window starts at CIRCWINDOW_START and counts down,
|
||||||
* to get the actual number of received cells for this check, we must
|
* to get the actual number of received cells for this check, we must
|
||||||
* first convert to receieved cells, or the modulus operator will fail.
|
* first convert to received cells, or the modulus operator will fail.
|
||||||
*/
|
*/
|
||||||
tor_assert(deliver_window <= CIRCWINDOW_START);
|
tor_assert(deliver_window <= CIRCWINDOW_START);
|
||||||
if (((CIRCWINDOW_START - (deliver_window - 1)) % sendme_inc) != 0) {
|
if (((CIRCWINDOW_START - (deliver_window - 1)) % sendme_inc) != 0) {
|
||||||
|
@ -1895,7 +1895,7 @@ make_guard_confirmed(guard_selection_t *gs, entry_guard_t *guard)
|
|||||||
|
|
||||||
guard->confirmed_idx = gs->next_confirmed_idx++;
|
guard->confirmed_idx = gs->next_confirmed_idx++;
|
||||||
smartlist_add(gs->confirmed_entry_guards, guard);
|
smartlist_add(gs->confirmed_entry_guards, guard);
|
||||||
/** The confirmation ordering might not be the sample ording. We need to
|
/** The confirmation ordering might not be the sample ordering. We need to
|
||||||
* reorder */
|
* reorder */
|
||||||
smartlist_sort(gs->confirmed_entry_guards, compare_guards_by_sampled_idx);
|
smartlist_sort(gs->confirmed_entry_guards, compare_guards_by_sampled_idx);
|
||||||
|
|
||||||
|
@ -1459,7 +1459,7 @@ configure_libevent_options(void)
|
|||||||
* the query itself timed out in transit. */
|
* the query itself timed out in transit. */
|
||||||
SET("timeout:", get_consensus_param_exit_dns_timeout());
|
SET("timeout:", get_consensus_param_exit_dns_timeout());
|
||||||
|
|
||||||
/* This tells libevent to attemps up to X times a DNS query if the previous
|
/* This tells libevent to attempt up to X times a DNS query if the previous
|
||||||
* one failed to complete within N second. We believe that this should be
|
* one failed to complete within N second. We believe that this should be
|
||||||
* enough to catch temporary hiccups on the first query. But after that, it
|
* enough to catch temporary hiccups on the first query. But after that, it
|
||||||
* should signal us that it won't be able to resolve it. */
|
* should signal us that it won't be able to resolve it. */
|
||||||
|
@ -862,7 +862,7 @@ test_channelpadding_decide_to_pad_channel(void *arg)
|
|||||||
* 2. Channel that has not "sent a packet" before the timeout:
|
* 2. Channel that has not "sent a packet" before the timeout:
|
||||||
* 2a. Not within 1.1s of the timeout.
|
* 2a. Not within 1.1s of the timeout.
|
||||||
* + We should decide to pad later
|
* + We should decide to pad later
|
||||||
* 2b. Within 1.1s of the timemout.
|
* 2b. Within 1.1s of the timeout.
|
||||||
* + We should schedule padding
|
* + We should schedule padding
|
||||||
* + We should get feedback that we wrote a cell
|
* + We should get feedback that we wrote a cell
|
||||||
* 2c. Within 0.1s of the timeout.
|
* 2c. Within 0.1s of the timeout.
|
||||||
|
@ -6435,7 +6435,7 @@ test_config_include_opened_file_list(void *data)
|
|||||||
tt_int_op(smartlist_len(opened_files), OP_EQ, 4);
|
tt_int_op(smartlist_len(opened_files), OP_EQ, 4);
|
||||||
tt_int_op(smartlist_contains_string(opened_files, torrcd), OP_EQ, 1);
|
tt_int_op(smartlist_contains_string(opened_files, torrcd), OP_EQ, 1);
|
||||||
tt_int_op(smartlist_contains_string(opened_files, subfolder), OP_EQ, 1);
|
tt_int_op(smartlist_contains_string(opened_files, subfolder), OP_EQ, 1);
|
||||||
// files inside subfolders are not opended, only the subfolder is opened
|
// files inside subfolders are not opened, only the subfolder is opened
|
||||||
tt_int_op(smartlist_contains_string(opened_files, empty), OP_EQ, 1);
|
tt_int_op(smartlist_contains_string(opened_files, empty), OP_EQ, 1);
|
||||||
tt_int_op(smartlist_contains_string(opened_files, file), OP_EQ, 1);
|
tt_int_op(smartlist_contains_string(opened_files, file), OP_EQ, 1);
|
||||||
// dot files are not opened as we ignore them when we get their name from
|
// dot files are not opened as we ignore them when we get their name from
|
||||||
|
@ -2073,7 +2073,7 @@ test_dir_handle_get_status_vote_next_bandwidth_not_found(void* data)
|
|||||||
conn = new_dir_conn();
|
conn = new_dir_conn();
|
||||||
|
|
||||||
tt_int_op(0, OP_EQ, directory_handle_command_get(conn,
|
tt_int_op(0, OP_EQ, directory_handle_command_get(conn,
|
||||||
GET("/tor/status-vote/next/bandwdith"), NULL, 0));
|
GET("/tor/status-vote/next/bandwidth"), NULL, 0));
|
||||||
|
|
||||||
fetch_from_buf_http(TO_CONN(conn)->outbuf, &header, MAX_HEADERS_SIZE,
|
fetch_from_buf_http(TO_CONN(conn)->outbuf, &header, MAX_HEADERS_SIZE,
|
||||||
NULL, NULL, 1, 0);
|
NULL, NULL, 1, 0);
|
||||||
|
@ -628,7 +628,7 @@ test_hs_control_store_permanent_creds(void *arg)
|
|||||||
tor_free(args);
|
tor_free(args);
|
||||||
tor_free(cp1);
|
tor_free(cp1);
|
||||||
|
|
||||||
/* Overwrite the credentials and check that they got overwrited. */
|
/* Overwrite the credentials and check that they got overwritten. */
|
||||||
args = tor_strdup("2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4ctdyd "
|
args = tor_strdup("2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4ctdyd "
|
||||||
"x25519:UDRvZLvcJo0QRLvDfkpgbtsqbkhIUQZyeo2FNBrgS18= "
|
"x25519:UDRvZLvcJo0QRLvDfkpgbtsqbkhIUQZyeo2FNBrgS18= "
|
||||||
"Flags=Permanent");
|
"Flags=Permanent");
|
||||||
|
@ -50,7 +50,7 @@ test_pe_initialize(void *arg)
|
|||||||
|
|
||||||
/* Initialize the events but the callback won't get called since we would
|
/* Initialize the events but the callback won't get called since we would
|
||||||
* need to run the main loop and then wait for a second delaying the unit
|
* need to run the main loop and then wait for a second delaying the unit
|
||||||
* tests. Instead, we'll test the callback work indepedently elsewhere. */
|
* tests. Instead, we'll test the callback work independently elsewhere. */
|
||||||
initialize_periodic_events();
|
initialize_periodic_events();
|
||||||
periodic_events_connect_all();
|
periodic_events_connect_all();
|
||||||
set_network_participation(false);
|
set_network_participation(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user