commit c93f66b1037e151268b5662f3957d13c4c94d1fb Merge: 4074ff4 690ea9e Author: Nick Mathewson nickm@torproject.org Date: Fri Feb 1 17:11:46 2013 -0500
Merge remote-tracking branch 'public/bug7708_023_v3_squashed'
changes/bug7708 | 5 +++++ src/or/connection.c | 20 ++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-)
diff --cc src/or/connection.c index c1cfbd6,10fee12..0d8242a --- a/src/or/connection.c +++ b/src/or/connection.c @@@ -3437,23 -3319,12 +3447,24 @@@ connection_handle_write_impl(connection if (result > 0) { /* If we wrote any bytes from our buffer, then call the appropriate * functions. */ - if (connection_flushed_some(conn) < 0) - connection_mark_for_close(conn); + if (connection_flushed_some(conn) < 0) { + if (connection_speaks_cells(conn)) { + connection_or_notify_error(TO_OR_CONN(conn), + END_OR_CONN_REASON_MISC, + "Got error back from " + "connection_flushed_some()"); + } + + /* + * This can bypass normal channel checking since we did + * connection_or_notify_error() above. + */ + connection_mark_for_close_internal(conn); + } }
- if (!connection_wants_to_flush(conn)) { /* it's done flushing */ + if (!connection_wants_to_flush(conn) && + !dont_stop_writing) { /* it's done flushing */ if (connection_finished_flushing(conn) < 0) { /* already marked */ return -1;