feat: log connection status changes at general=info level (NEW/UP/DOWN/DELETE)
This commit is contained in:
1 parent
47776030b0
commit
2f759b2302
1 file changed
+3
@@ -288,6 +288,9 @@ struct ETCP_CONN* etcp_connection_create(struct UTUN_INSTANCE* instance, char* n
|
||||
|
||||
static void etcp_fire_conn_status(struct ETCP_CONN* etcp, int status) {
|
||||
if (!etcp || !etcp->instance) return;
|
||||
static const char* names[] = { "NEW", "UP", "DOWN", "DELETE" };
|
||||
DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "[%s] Connection status changed to %s", etcp->log_name,
|
||||
(status >= 0 && status < (int)(sizeof(names)/sizeof(names[0]))) ? names[status] : "?");
|
||||
struct etcp_status_cbk_entry* cbe = etcp->instance->conn_status_cbks;
|
||||
while (cbe) { struct etcp_status_cbk_entry* n = cbe->next; cbe->fn(etcp, status, cbe->arg); cbe = n; }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user