Skip to content
  • David Goulet's avatar
    conn: Close the read side of a closing connection when write limit is reached · c99f220f
    David Goulet authored and Nick Mathewson's avatar Nick Mathewson committed
    
    
    In conn_close_if_marked(), we can decide to keep a connection open that still
    has data to flush on the wire if it is being rate limited on the write side.
    
    However, in this process, we were also looking at the read() side which can
    still have token in its bucket and thus not stop the reading. This lead to a
    BUG() introduced in 0.3.4.1-alpha that was expecting the read side to be
    closed due to the rate limit but which only applies on the write side.
    
    This commit removes any bandwidth check on the read side and simply stop the
    read side on the connection regardless of the bucket state. If we keep the
    connection open to flush it out before close, we should not read anything.
    
    Fixes #27750
    
    Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
    c99f220f