diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-11-14 15:43:46 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-11-14 15:43:46 -0500 |
commit | d598d834f5ce3ae3decb53336c95c8f5d361587a (patch) | |
tree | 04416c710590a492d779d8262598ae6a3fce7a17 /src | |
parent | a58b19465d9ffada3df87ea9be769d1f27c414cc (diff) | |
parent | c99f220f7857e40bd9c09bd0c240b3b9aea4d6f8 (diff) | |
download | tor-d598d834f5ce3ae3decb53336c95c8f5d361587a.tar.gz tor-d598d834f5ce3ae3decb53336c95c8f5d361587a.zip |
Merge branch 'ticket27750_034_01_squashed' into maint-0.3.5
Diffstat (limited to 'src')
-rw-r--r-- | src/core/mainloop/mainloop.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/core/mainloop/mainloop.c b/src/core/mainloop/mainloop.c index a9f1429787..7eff82fee4 100644 --- a/src/core/mainloop/mainloop.c +++ b/src/core/mainloop/mainloop.c @@ -1011,23 +1011,18 @@ conn_close_if_marked(int i) * busy Libevent loops where we keep ending up here and returning * 0 until we are no longer blocked on bandwidth. */ - connection_consider_empty_read_buckets(conn); connection_consider_empty_write_buckets(conn); - /* Make sure that consider_empty_buckets really disabled the * connection: */ if (BUG(connection_is_writing(conn))) { connection_write_bw_exhausted(conn, true); } - if (BUG(connection_is_reading(conn))) { - /* XXXX+ We should make this code unreachable; if a connection is - * marked for close and flushing, there is no point in reading to it - * at all. Further, checking at this point is a bit of a hack: it - * would make much more sense to react in - * connection_handle_read_impl, or to just stop reading in - * mark_and_flush */ - connection_read_bw_exhausted(conn, true/* kludge. */); - } + + /* The connection is being held due to write rate limit and thus will + * flush its data later. We need to stop reading because this + * connection is about to be closed once flushed. It should not + * process anything more coming in at this stage. */ + connection_stop_reading(conn); } return 0; } |