struct NeighbourMapEntry *n = cls;
n->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ if (GNUNET_YES == n->is_connected)
+ GNUNET_STATISTICS_update (GST_stats,
+ gettext_noop ("# peers disconnected due to timeout"), 1,
+ GNUNET_NO);
disconnect_neighbour (n);
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting peer `%4s', %s\n",
GNUNET_i2s (&n->id), "SHUTDOWN_TASK");
#endif
+ if (GNUNET_YES == n->is_connected)
+ GNUNET_STATISTICS_update (GST_stats,
+ gettext_noop ("# peers disconnected due to global disconnect"), 1,
+ GNUNET_NO);
disconnect_neighbour (n);
return GNUNET_OK;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting peer `%4s' due to `%s'\n",
GNUNET_i2s (&n->id), "SET_QUOTA");
#endif
- GNUNET_STATISTICS_update (GST_stats,
- gettext_noop ("# disconnects due to quota of 0"), 1,
- GNUNET_NO);
+ if (GNUNET_YES == n->is_connected)
+ GNUNET_STATISTICS_update (GST_stats,
+ gettext_noop ("# disconnects due to quota of 0"), 1,
+ GNUNET_NO);
disconnect_neighbour (n);
}
UINT32_MAX /* priority */ ,
GNUNET_TIME_UNIT_FOREVER_REL, n->session, n->addr, n->addrlen,
GNUNET_YES, NULL, NULL);
+ GNUNET_STATISTICS_update (GST_stats,
+ gettext_noop ("# peers disconnected due to external request"), 1,
+ GNUNET_NO);
}
disconnect_neighbour (n);
}