[or-cvs] r16143: In connection_edge_destroy, send a stream status control eve (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Wed Jul 23 14:07:26 UTC 2008


Author: nickm
Date: 2008-07-23 10:07:26 -0400 (Wed, 23 Jul 2008)
New Revision: 16143

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/connection_edge.c
Log:
 r17308 at aud-055:  nickm | 2008-07-23 15:57:41 +0200
 In connection_edge_destroy, send a stream status control event when we have an AP connection.  Previously, we would send an event when the connection was AP and non-AP at the same time.  This didn't work so well.  Patch from Anonymous Remailer (Austria).  Backport candidate.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r17308] on 49666b30-7950-49c5-bedf-9dc8f3168102

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2008-07-23 13:51:13 UTC (rev 16142)
+++ tor/trunk/ChangeLog	2008-07-23 14:07:26 UTC (rev 16143)
@@ -39,6 +39,11 @@
       don't reschedule publication of the next descriptor. Fixes bug 763.
       Bugfix on 0.0.9.3.
 
+  o Minor bugfixes (controller):
+    - When closing an application-side connection because its circuit
+      is getting torn down, generate the stream event correctly.
+      Bugfix on 0.1.2.x.  Anonymous patch.
+
   o Removed features
     - Remove all backward-compatibility code to support servers running
       versions of Tor so old as to no longer work at all on the Tor network.

Modified: tor/trunk/src/or/connection_edge.c
===================================================================
--- tor/trunk/src/or/connection_edge.c	2008-07-23 13:51:13 UTC (rev 16142)
+++ tor/trunk/src/or/connection_edge.c	2008-07-23 14:07:26 UTC (rev 16143)
@@ -160,14 +160,14 @@
              "CircID %d: At an edge. Marking connection for close.", circ_id);
     if (conn->_base.type == CONN_TYPE_AP) {
       connection_mark_unattached_ap(conn, END_STREAM_REASON_DESTROY);
+      control_event_stream_status(conn, STREAM_EVENT_CLOSED,
+                                  END_STREAM_REASON_DESTROY);
+      conn->end_reason |= END_STREAM_REASON_FLAG_ALREADY_SENT_CLOSED;
     } else {
       /* closing the circuit, nothing to send an END to */
       conn->_base.edge_has_sent_end = 1;
       conn->end_reason = END_STREAM_REASON_DESTROY;
       conn->end_reason |= END_STREAM_REASON_FLAG_ALREADY_SENT_CLOSED;
-      if (conn->_base.type == CONN_TYPE_AP)
-        control_event_stream_status(conn, STREAM_EVENT_CLOSED,
-                                    END_STREAM_REASON_DESTROY);
       connection_mark_for_close(TO_CONN(conn));
       conn->_base.hold_open_until_flushed = 1;
     }



More information about the tor-commits mailing list