Make circuit_resume_edge_reading_helper treat streams more fairly.
commit424ca963ad7b08822b82491fbeba05438ddf5da2
authorNick Mathewson <nickm@torproject.org>
Mon, 13 Sep 2010 21:04:13 +0000 (13 17:04 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 13 Sep 2010 22:59:50 +0000 (13 18:59 -0400)
tree13872e0c322fa630cd6f6662edaad9d665ac6bf6
parentb582eb32b820e53dcd8ac9db58f6000b88cf2e4e
Make circuit_resume_edge_reading_helper treat streams more fairly.

Previously[*], the function would start with the first stream on the
circuit, and let it package as many cells as it wanted before
proceeding to the next stream in turn.  If a circuit had many live
streams that all wanted to package data, the oldest would get
preference, and the newest would get ignored.

Now, we figure out how many cells we're willing to send per stream,
and try to allocate them fairly.

Roger diagnosed this in the comments for bug 1298.

[*] This bug has existed since before the first-ever public release
    of Tor.  It was added by r152 of Tor on 26 Jan 2003, which was
    the first commit to implement streams (then called "topics").

    This is not the oldest bug to be fixed in 0.2.2.x: that honor
    goes to the windowing bug in r54, which got fixed in e50b7768 by
    Roger with diagnosis by Karsten.  This is, however, the most
    long-lived bug to be fixed in 0.2.2.x: the r54 bug was fixed
    2580 days after it was introduced, whereas I am writing this
    commit message 2787 days after r152.
changes/bug1937 [new file with mode: 0644]
src/or/relay.c