Procházet zdrojové kódy

Assert if connection is trying to change out of the CLOSED state.

Steven Engler před 4 roky
rodič
revize
9d4e217b85
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  1. 7 0
      src/core/or/safe_connection.c

+ 7 - 0
src/core/or/safe_connection.c

@@ -855,6 +855,13 @@ safe_or_connection_update_state(safe_or_connection_t *safe_or_conn,
                     "of %d", new_state);
   }
 
+  if (safe_or_conn->state == SAFE_OR_CONN_STATE_CLOSED &&
+      new_state != SAFE_OR_CONN_STATE_CLOSED) {
+    log_warn(LD_OR, "Trying to change out of the CLOSED state "
+                    "(or_conn_state_t) to %d", new_state);
+    tor_assert(0);
+  }
+
   event_data_t null_data = { .ptr = NULL };
   // this is used by several cases below