mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 14:23:30 +01:00
Query circuit count from associated channel of or_conn in control.c
This commit is contained in:
parent
35924435d2
commit
6cce6241dd
@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
#include "or.h"
|
#include "or.h"
|
||||||
#include "buffers.h"
|
#include "buffers.h"
|
||||||
|
#include "channel.h"
|
||||||
|
#include "channeltls.h"
|
||||||
#include "circuitbuild.h"
|
#include "circuitbuild.h"
|
||||||
#include "circuitlist.h"
|
#include "circuitlist.h"
|
||||||
#include "circuituse.h"
|
#include "circuituse.h"
|
||||||
@ -3822,7 +3824,11 @@ control_event_or_conn_status(or_connection_t *conn, or_conn_status_event_t tp,
|
|||||||
log_warn(LD_BUG, "Unrecognized status code %d", (int)tp);
|
log_warn(LD_BUG, "Unrecognized status code %d", (int)tp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
ncircs = circuit_count_pending_on_or_conn(conn);
|
if (conn->chan) {
|
||||||
|
ncircs = circuit_count_pending_on_channel(TLS_CHAN_TO_BASE(conn->chan));
|
||||||
|
} else {
|
||||||
|
ncircs = 0;
|
||||||
|
}
|
||||||
ncircs += conn->n_circuits;
|
ncircs += conn->n_circuits;
|
||||||
if (ncircs && (tp == OR_CONN_EVENT_FAILED || tp == OR_CONN_EVENT_CLOSED)) {
|
if (ncircs && (tp == OR_CONN_EVENT_FAILED || tp == OR_CONN_EVENT_CLOSED)) {
|
||||||
tor_snprintf(ncircs_buf, sizeof(ncircs_buf), "%sNCIRCS=%d",
|
tor_snprintf(ncircs_buf, sizeof(ncircs_buf), "%sNCIRCS=%d",
|
||||||
|
Loading…
Reference in New Issue
Block a user