Loading changes/bug22805 0 → 100644 +10 −0 Original line number Diff line number Diff line o Minor features (relay): - When choosing which circuits can be expired as unused, consider circuits from clients even if those clients used regular CREATE cells to make them; and do not consider circuits from relays even if they were made with CREATE_FAST. Part of ticket 22805. o Code simplification and refactoring: - Remove various ways of testing circuits and connections for "clientness"; instead, favor channel_is_client(). Part of ticket 22805. src/or/channel.c +15 −1 Original line number Diff line number Diff line Loading @@ -4090,7 +4090,7 @@ channel_mark_bad_for_new_circs(channel_t *chan) */ int channel_is_client(channel_t *chan) channel_is_client(const channel_t *chan) { tor_assert(chan); Loading @@ -4111,6 +4111,20 @@ channel_mark_client(channel_t *chan) chan->is_client = 1; } /** * Clear the client flag * * Mark a channel as being _not_ from a client */ void channel_clear_client(channel_t *chan) { tor_assert(chan); chan->is_client = 0; } /** * Get the canonical flag for a channel * Loading src/or/channel.h +2 −1 Original line number Diff line number Diff line Loading @@ -666,11 +666,12 @@ int channel_is_bad_for_new_circs(channel_t *chan); void channel_mark_bad_for_new_circs(channel_t *chan); int channel_is_canonical(channel_t *chan); int channel_is_canonical_is_reliable(channel_t *chan); int channel_is_client(channel_t *chan); int channel_is_client(const channel_t *chan); int channel_is_local(channel_t *chan); int channel_is_incoming(channel_t *chan); int channel_is_outgoing(channel_t *chan); void channel_mark_client(channel_t *chan); void channel_clear_client(channel_t *chan); int channel_matches_extend_info(channel_t *chan, extend_info_t *extend_info); int channel_matches_target_addr_for_extend(channel_t *chan, const tor_addr_t *target); Loading src/or/channelpadding.c +1 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ static int consensus_nf_pad_single_onion; * its a client, use that. Then finally verify in the consensus). */ #define CHANNEL_IS_CLIENT(chan, options) \ (!public_server_mode((options)) || (chan)->is_client || \ (!public_server_mode((options)) || channel_is_client(chan) || \ !connection_or_digest_is_known_relay((chan)->identity_digest)) /** Loading src/or/circuitbuild.c +2 −2 Original line number Diff line number Diff line Loading @@ -1612,12 +1612,12 @@ onionskin_answer(or_circuit_t *circ, memcpy(circ->rend_circ_nonce, rend_circ_nonce, DIGEST_LEN); circ->is_first_hop = (created_cell->cell_type == CELL_CREATED_FAST); int used_create_fast = (created_cell->cell_type == CELL_CREATED_FAST); append_cell_to_circuit_queue(TO_CIRCUIT(circ), circ->p_chan, &cell, CELL_DIRECTION_IN, 0); log_debug(LD_CIRC,"Finished sending '%s' cell.", circ->is_first_hop ? "created_fast" : "created"); used_create_fast ? "created_fast" : "created"); /* Ignore the local bit when ExtendAllowPrivateAddresses is set: * it violates the assumption that private addresses are local. Loading Loading
changes/bug22805 0 → 100644 +10 −0 Original line number Diff line number Diff line o Minor features (relay): - When choosing which circuits can be expired as unused, consider circuits from clients even if those clients used regular CREATE cells to make them; and do not consider circuits from relays even if they were made with CREATE_FAST. Part of ticket 22805. o Code simplification and refactoring: - Remove various ways of testing circuits and connections for "clientness"; instead, favor channel_is_client(). Part of ticket 22805.
src/or/channel.c +15 −1 Original line number Diff line number Diff line Loading @@ -4090,7 +4090,7 @@ channel_mark_bad_for_new_circs(channel_t *chan) */ int channel_is_client(channel_t *chan) channel_is_client(const channel_t *chan) { tor_assert(chan); Loading @@ -4111,6 +4111,20 @@ channel_mark_client(channel_t *chan) chan->is_client = 1; } /** * Clear the client flag * * Mark a channel as being _not_ from a client */ void channel_clear_client(channel_t *chan) { tor_assert(chan); chan->is_client = 0; } /** * Get the canonical flag for a channel * Loading
src/or/channel.h +2 −1 Original line number Diff line number Diff line Loading @@ -666,11 +666,12 @@ int channel_is_bad_for_new_circs(channel_t *chan); void channel_mark_bad_for_new_circs(channel_t *chan); int channel_is_canonical(channel_t *chan); int channel_is_canonical_is_reliable(channel_t *chan); int channel_is_client(channel_t *chan); int channel_is_client(const channel_t *chan); int channel_is_local(channel_t *chan); int channel_is_incoming(channel_t *chan); int channel_is_outgoing(channel_t *chan); void channel_mark_client(channel_t *chan); void channel_clear_client(channel_t *chan); int channel_matches_extend_info(channel_t *chan, extend_info_t *extend_info); int channel_matches_target_addr_for_extend(channel_t *chan, const tor_addr_t *target); Loading
src/or/channelpadding.c +1 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ static int consensus_nf_pad_single_onion; * its a client, use that. Then finally verify in the consensus). */ #define CHANNEL_IS_CLIENT(chan, options) \ (!public_server_mode((options)) || (chan)->is_client || \ (!public_server_mode((options)) || channel_is_client(chan) || \ !connection_or_digest_is_known_relay((chan)->identity_digest)) /** Loading
src/or/circuitbuild.c +2 −2 Original line number Diff line number Diff line Loading @@ -1612,12 +1612,12 @@ onionskin_answer(or_circuit_t *circ, memcpy(circ->rend_circ_nonce, rend_circ_nonce, DIGEST_LEN); circ->is_first_hop = (created_cell->cell_type == CELL_CREATED_FAST); int used_create_fast = (created_cell->cell_type == CELL_CREATED_FAST); append_cell_to_circuit_queue(TO_CIRCUIT(circ), circ->p_chan, &cell, CELL_DIRECTION_IN, 0); log_debug(LD_CIRC,"Finished sending '%s' cell.", circ->is_first_hop ? "created_fast" : "created"); used_create_fast ? "created_fast" : "created"); /* Ignore the local bit when ExtendAllowPrivateAddresses is set: * it violates the assumption that private addresses are local. Loading