From: Nick Mathewson Date: Fri, 1 Feb 2013 22:11:46 +0000 (-0500) Subject: Merge remote-tracking branch 'public/bug7708_023_v3_squashed' X-Git-Tag: tor-0.2.4.10-alpha~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c93f66b1037e151268b5662f3957d13c4c94d1fb;p=thirdparty%2Ftor.git Merge remote-tracking branch 'public/bug7708_023_v3_squashed' --- c93f66b1037e151268b5662f3957d13c4c94d1fb diff --cc src/or/connection.c index c1cfbd61f7,10fee1248b..0d8242a54e --- 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;