]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
New and improved circuitmux_detach_all_circuits(), now without the stupid
authorAndrea Shepard <andrea@torproject.org>
Tue, 2 Oct 2012 04:03:38 +0000 (21:03 -0700)
committerAndrea Shepard <andrea@torproject.org>
Wed, 10 Oct 2012 07:44:47 +0000 (00:44 -0700)
src/or/circuitmux.c

index d4ea64367962982c4fefe506ca5f512fe62be813..7be68583c100ed73e3158ad78bec877dd20adb34 100644 (file)
@@ -369,24 +369,24 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
         if (circ) {
           /* Clear the circuit's mux for this direction */
           if (to_remove->muxinfo.direction == CELL_DIRECTION_OUT) {
-            /* Clear n_mux */
-            circ->n_mux = NULL;
             /*
              * Update active_circuits et al.; this does policy notifies, so
              * comes before freeing policy data
              */
             circuitmux_make_circuit_inactive(cmux, circ, CELL_DIRECTION_OUT);
+            /* Clear n_mux */
+            circ->n_mux = NULL;
           } else if (circ->magic == OR_CIRCUIT_MAGIC) {
-            /*
-             * It has a sensible p_chan and direction == CELL_DIRECTION_IN,
-             * so clear p_mux.
-             */
-            TO_OR_CIRCUIT(circ)->p_mux = NULL;
             /*
              * Update active_circuits et al.; this does policy notifies, so
              * comes before freeing policy data
              */
             circuitmux_make_circuit_inactive(cmux, circ, CELL_DIRECTION_IN);
+            /*
+             * It has a sensible p_chan and direction == CELL_DIRECTION_IN,
+             * so clear p_mux.
+             */
+            TO_OR_CIRCUIT(circ)->p_mux = NULL;
           } else {
             /* Complain and move on */
             log_warn(LD_CIRC,