char hexid[HEX_DIGEST_LEN+1];
base16_encode(hexid, HEX_DIGEST_LEN+1, id, DIGEST_LEN);
+ if (!strcmp(hexid, "0000000000000000000000000000000000000000"))
+ return NULL;
+
hist = (or_history_t*) strmap_get(history_map, hexid);
if (!hist) {
hist = tor_malloc_zero(sizeof(or_history_t));
link_history_t *lhist;
char to_hexid[HEX_DIGEST_LEN+1];
orhist = get_or_history(from_id);
+ if (!orhist)
+ return NULL;
base16_encode(to_hexid, HEX_DIGEST_LEN+1, to_id, DIGEST_LEN);
+ if (!strcmp(hexid, "0000000000000000000000000000000000000000"))
+ return NULL;
lhist = (link_history_t*) strmap_get(orhist->link_history_map, to_hexid);
if (!lhist) {
lhist = tor_malloc_zero(sizeof(link_history_t));
{
or_history_t *hist;
hist = get_or_history(id);
+ if (!hist)
+ return;
++hist->n_conn_fail;
if (hist->up_since) {
hist->uptime += (when - hist->up_since);
{
or_history_t *hist;
hist = get_or_history(id);
+ if (!hist)
+ return;
++hist->n_conn_ok;
if (hist->down_since) {
hist->downtime += (when - hist->down_since);
{
or_history_t *hist;
hist = get_or_history(id);
+ if (!hist)
+ return;
++hist->n_conn_ok;
if (hist->up_since) {
hist->uptime += (when - hist->up_since);
return;
}
hist = get_or_history(id);
+ if (!hist)
+ return;
if (hist->up_since) {
hist->uptime += (when - hist->up_since);
hist->up_since = 0;
link_history_t *hist;
/* log_fn(LOG_WARN, "EXTEND SUCCEEDED: %s->%s",from_name,to_name); */
hist = get_link_history(from_id, to_id);
+ if (!hist)
+ return;
++hist->n_extend_ok;
}
link_history_t *hist;
/* log_fn(LOG_WARN, "EXTEND FAILED: %s->%s",from_name,to_name); */
hist = get_link_history(from_id, to_id);
+ if (!hist)
+ return;
++hist->n_extend_fail;
}
or_history->n_conn_ok, or_history->n_conn_fail+or_history->n_conn_ok,
upt, upt+downt, uptime*100.0);
- strcpy(buffer, " Good extend attempts: ");
+ if (!strmap_isempty(or_history->link_history_map)) {
+ strcpy(buffer, " Good extend attempts: ");
+ }
len = strlen(buffer);
for (lhist_it = strmap_iter_init(or_history->link_history_map);
!strmap_iter_done(lhist_it);