mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
when counting how many being-built circs will handle a stream,
don't count ones that are too old svn:r1517
This commit is contained in:
parent
ff76072feb
commit
cf67520e95
@ -459,10 +459,13 @@ int circuit_stream_is_being_handled(connection_t *conn) {
|
|||||||
circuit_t *circ;
|
circuit_t *circ;
|
||||||
routerinfo_t *exitrouter;
|
routerinfo_t *exitrouter;
|
||||||
int num=0;
|
int num=0;
|
||||||
|
time_t now = time(NULL);
|
||||||
|
|
||||||
for(circ=global_circuitlist;circ;circ = circ->next) {
|
for(circ=global_circuitlist;circ;circ = circ->next) {
|
||||||
if(circ->cpath && circ->state != CIRCUIT_STATE_OPEN &&
|
if(circ->cpath && circ->state != CIRCUIT_STATE_OPEN &&
|
||||||
!circ->marked_for_close && circ->purpose == CIRCUIT_PURPOSE_C_GENERAL) {
|
!circ->marked_for_close && circ->purpose == CIRCUIT_PURPOSE_C_GENERAL &&
|
||||||
|
(!circ->timestamp_dirty ||
|
||||||
|
circ->timestamp_dirty + options.NewCircuitPeriod < now)) {
|
||||||
exitrouter = router_get_by_nickname(circ->build_state->chosen_exit);
|
exitrouter = router_get_by_nickname(circ->build_state->chosen_exit);
|
||||||
if(exitrouter && connection_ap_can_use_exit(conn, exitrouter) != ADDR_POLICY_REJECTED)
|
if(exitrouter && connection_ap_can_use_exit(conn, exitrouter) != ADDR_POLICY_REJECTED)
|
||||||
if(++num >= MIN_CIRCUITS_HANDLING_STREAM)
|
if(++num >= MIN_CIRCUITS_HANDLING_STREAM)
|
||||||
|
Loading…
Reference in New Issue
Block a user