]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
fix an assert trigger where an OP would fail to handshake, and we'd
authorRoger Dingledine <arma@torproject.org>
Sat, 27 Mar 2004 01:28:14 +0000 (01:28 +0000)
committerRoger Dingledine <arma@torproject.org>
Sat, 27 Mar 2004 01:28:14 +0000 (01:28 +0000)
expect it to have a nickname.

svn:r1351

src/or/connection.c

index f78033b91e1ae11955c3456a31d9d6f5e2e51365..c7f3867d048081c9253024b5bca8cce62315c5c5 100644 (file)
@@ -187,7 +187,11 @@ _connection_mark_for_close(connection_t *conn, char reason)
     case CONN_TYPE_OR:
       /* Remember why we're closing this connection. */
       if (conn->state != OR_CONN_STATE_OPEN) {
-        rep_hist_note_connect_failed(conn->nickname, time(NULL));
+        /* XXX Nick: this still isn't right, because it might be
+         * dying even though we didn't initiate the connect. Can
+         * you look at this more? -RD */
+        if(conn->nickname)
+          rep_hist_note_connect_failed(conn->nickname, time(NULL));
       } else if (reason == CLOSE_REASON_UNUSED_OR_CONN) {
         rep_hist_note_disconnect(conn->nickname, time(NULL));
       } else {