|
@@ -115,6 +115,7 @@ int connection_edge_destroy(uint16_t circ_id, connection_t *conn) {
|
|
conn->has_sent_end = 1; /* we're closing the circuit, nothing to send to */
|
|
conn->has_sent_end = 1; /* we're closing the circuit, nothing to send to */
|
|
connection_mark_for_close(conn);
|
|
connection_mark_for_close(conn);
|
|
conn->hold_open_until_flushed = 1;
|
|
conn->hold_open_until_flushed = 1;
|
|
|
|
+ conn->cpath_layer = NULL;
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -141,6 +142,12 @@ connection_edge_end(connection_t *conn, char reason, crypt_path_t *cpath_layer)
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (conn->marked_for_close) {
|
|
|
|
+ log_fn(LOG_WARN,"Bug: called on conn that's already marked for close at %s:%d.",
|
|
|
|
+ conn->marked_for_close_file, conn->marked_for_close);
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
payload[0] = reason;
|
|
payload[0] = reason;
|
|
if (reason == END_STREAM_REASON_EXITPOLICY) {
|
|
if (reason == END_STREAM_REASON_EXITPOLICY) {
|
|
/* this is safe even for rend circs, because they never fail
|
|
/* this is safe even for rend circs, because they never fail
|