DFLT_PATH_BIAS_SCALE_THRESHOLD, 1, INT32_MAX);
}
-const char *
+static const char *
pathbias_state_to_string(path_state_t state)
{
- switch(state) {
+ switch (state) {
case PATH_STATE_NEW_CIRC:
- return "new";
+ return "new";
case PATH_STATE_DID_FIRST_HOP:
- return "first hop";
+ return "first hop";
case PATH_STATE_SUCCEEDED:
return "succeeded";
}
return "unknown";
}
-
/**
* Check our circuit state to see if this is a successful first hop.
* If so, record it in the current guard's path bias first_hop count.
pathbias_count_first_hop(origin_circuit_t *circ)
{
#define FIRST_HOP_NOTICE_INTERVAL (600)
- static ratelim_t first_hop_notice_limit = RATELIM_INIT(FIRST_HOP_NOTICE_INTERVAL);
+ static ratelim_t first_hop_notice_limit =
+ RATELIM_INIT(FIRST_HOP_NOTICE_INTERVAL);
char *rate_msg = NULL;
/* Completely ignore one hop circuits */
"A %s circuit is in cpath state %d (opened: %d). "
"Circuit is a %s currently %s. %s",
pathbias_state_to_string(circ->path_state),
- circ->cpath->state, circ->has_opened,
+ circ->cpath->state, circ->has_opened,
circuit_purpose_to_string(circ->_base.purpose),
circuit_state_to_string(circ->_base.state),
rate_msg);
pathbias_count_success(origin_circuit_t *circ)
{
#define SUCCESS_NOTICE_INTERVAL (600)
- static ratelim_t success_notice_limit = RATELIM_INIT(SUCCESS_NOTICE_INTERVAL);
+ static ratelim_t success_notice_limit =
+ RATELIM_INIT(SUCCESS_NOTICE_INTERVAL);
char *rate_msg = NULL;
/* Ignore one hop circuits */
}
}
-
/** Increment the number of times we successfully extended a circuit to
* 'guard', first checking if the failure rate is high enough that we should
* eliminate the guard. Return -1 if the guard looks no good; return 0 if the
crypt_path_t *hop;
int rv;
- if((rv = pathbias_count_first_hop(circ)) < 0)
+ if ((rv = pathbias_count_first_hop(circ)) < 0)
return rv;
if (circ->cpath->state == CPATH_STATE_AWAITING_KEYS) {