diff options
author | Mike Perry <mikeperry-git@torproject.org> | 2018-08-04 19:38:38 +0000 |
---|---|---|
committer | Mike Perry <mikeperry-git@torproject.org> | 2018-08-29 04:12:09 +0000 |
commit | c56f63eadbc5b83b48e57235b194bd8f76b534bb (patch) | |
tree | 5bba29ea2a12e68d32da711cf69d59f234203e24 /src/or/or.h | |
parent | dac7d929185e5f2643a29fc046ee439a826239eb (diff) | |
download | tor-c56f63eadbc5b83b48e57235b194bd8f76b534bb.tar.gz tor-c56f63eadbc5b83b48e57235b194bd8f76b534bb.zip |
Ticket #25573: Track half-closed stream ids
We allow their CONNECTEDs, RESOLVEDs, ENDs, SENDMEs, and DATA cells to not
count as dropped until the windows are empty, or we get an END.
This commit does not change behavior. It only changes CIRC_BW event field
values.
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h index db8f9544fe..98b7fc9772 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1745,6 +1745,27 @@ typedef struct edge_connection_t { uint64_t dirreq_id; } edge_connection_t; +/** + * Struct to track a connection that we closed that the other end + * still thinks is open. Exists in origin_circuit_t.half_streams until + * we get an end cell or a resolved cell for this stream id. + */ +typedef struct half_edge_t { + /** stream_id for the half-closed connection */ + streamid_t stream_id; + + /** How many sendme's can the other end still send, based on how + * much data we had sent at the time of close */ + int sendmes_pending; + + /** How much more data can the other end still send, based on + * our deliver window */ + int data_pending; + + /** Is there a connected cell pending? */ + int connected_pending : 1; +} half_edge_t; + /** Subtype of edge_connection_t for an "entry connection" -- that is, a SOCKS * connection, a DNS request, a TransPort connection or a NATD connection */ typedef struct entry_connection_t { @@ -3261,6 +3282,10 @@ typedef struct origin_circuit_t { * associated with this circuit. */ edge_connection_t *p_streams; + /** Smartlist of half-closed streams (half_edge_t*) that still + * have pending activity */ + smartlist_t *half_streams; + /** Bytes read on this circuit since last call to * control_event_circ_bandwidth_used(). Only used if we're configured * to emit CIRC_BW events. */ |