Refactor stream blocking due to channel cell queues
commit21c861bfa3188444798a35e21f26579dd910a452
authorMike Perry <mikeperry-git@torproject.org>
Fri, 20 Jan 2023 19:14:33 +0000 (20 19:14 +0000)
committerMike Perry <mikeperry-git@torproject.org>
Thu, 6 Apr 2023 15:57:10 +0000 (6 15:57 +0000)
treebd09bd363fa67cee794aa1bc1a1e4268ae70155e
parenta4ee0c29ee52052f82692f0825a50e1a55e01e5c
Refactor stream blocking due to channel cell queues

Streams can get blocked on a circuit in two ways:
  1. When the circuit package window is full
  2. When the channel's cell queue is too high

Conflux needs to decouple stream blocking from both of these conditions,
because streams can continue on another circuit, even if the primary circuit
is blocked for either of these cases.

However, both conflux and congestion control need to know if the channel's
cell queue hit the highwatermark and is still draining, because this condition
is used by those components, independent of stream state.

Therefore, this commit renames the 'streams_blocked_on_chan' variable to
signify that it refers to the cell queue state, and also refactors the actual
stream blocking bits out, so they can be handled separately if conflux is
present.
src/core/mainloop/mainloop.c
src/core/mainloop/mainloop.h
src/core/or/circuit_st.h
src/core/or/circuituse.c
src/core/or/congestion_control_common.c
src/core/or/edge_connection_st.h
src/core/or/relay.c
src/test/fakecircs.c