]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge remote-tracking branch 'public/bug7708_023_v3_squashed'
authorNick Mathewson <nickm@torproject.org>
Fri, 1 Feb 2013 22:11:46 +0000 (17:11 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 1 Feb 2013 22:11:46 +0000 (17:11 -0500)
1  2 
src/or/connection.c

index c1cfbd61f7391205fd5d6f80f11e0f92786a98fb,10fee1248ba665b0e469fffbadb5ead162e618c9..0d8242a54e2083eef19ca3e0b6cc3371985634a1
@@@ -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;