better serverlist logging
This commit is contained in:
parent
4eedaf9bd0
commit
f0da8b1384
@ -51,6 +51,7 @@ struct sockaddr_in clientaddr_in; /* Remote socket address */
|
|||||||
int changed = FALSE; /* Databases changed */
|
int changed = FALSE; /* Databases changed */
|
||||||
char crbuf[512]; /* Chat receive buffer */
|
char crbuf[512]; /* Chat receive buffer */
|
||||||
char csbuf[512]; /* Chat send buffer */
|
char csbuf[512]; /* Chat send buffer */
|
||||||
|
int srvchg = FALSE; /* Is serverlist changed */
|
||||||
|
|
||||||
|
|
||||||
pthread_mutex_t b_mutex = PTHREAD_MUTEX_INITIALIZER;
|
pthread_mutex_t b_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
@ -132,7 +133,7 @@ void dump_ncslist(void)
|
|||||||
ncs_list *tmp;
|
ncs_list *tmp;
|
||||||
srv_list *srv;
|
srv_list *srv;
|
||||||
|
|
||||||
if (!changed)
|
if (!changed && !srvchg)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Syslog('r', "Server State Del Pwd Srv Next action");
|
Syslog('r', "Server State Del Pwd Srv Next action");
|
||||||
@ -144,11 +145,15 @@ void dump_ncslist(void)
|
|||||||
tmp->gotserver ? "yes":"no ", (int)tmp->action - (int)now);
|
tmp->gotserver ? "yes":"no ", (int)tmp->action - (int)now);
|
||||||
}
|
}
|
||||||
|
|
||||||
Syslog('r', "Server Router Hops Users Connect time");
|
if (srvchg) {
|
||||||
Syslog('r', "------------------------- ------------------------- ----- ----- --------------------");
|
Syslog('+', "IBC: Server Router Hops Users Connect time");
|
||||||
for (srv = servers; srv; srv = srv->next) {
|
Syslog('+', "IBC: ------------------------- ------------------------- ----- ----- --------------------");
|
||||||
Syslog('r', "%-25s %-25s %5d %5d %s", srv->server, srv->router, srv->hops, srv->users, rfcdate(srv->connected));
|
for (srv = servers; srv; srv = srv->next) {
|
||||||
|
Syslog('+', "IBC: %-25s %-25s %5d %5d %s", srv->server, srv->router, srv->hops, srv->users, rfcdate(srv->connected));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
srvchg = FALSE;
|
||||||
changed = FALSE;
|
changed = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,6 +213,8 @@ void add_server(srv_list **fdp, char *name, int hops, char *prod, char *vers, ch
|
|||||||
|
|
||||||
if ((rc = pthread_mutex_unlock(&b_mutex)))
|
if ((rc = pthread_mutex_unlock(&b_mutex)))
|
||||||
Syslog('!', "fill_ncslist() mutex_unlock failed rc=%d", rc);
|
Syslog('!', "fill_ncslist() mutex_unlock failed rc=%d", rc);
|
||||||
|
|
||||||
|
srvchg = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -232,6 +239,7 @@ void del_server(srv_list **fap, char *name)
|
|||||||
while ((tan = ta->next) && (strcmp(tan->server, name) == 0)) {
|
while ((tan = ta->next) && (strcmp(tan->server, name) == 0)) {
|
||||||
ta->next = tan->next;
|
ta->next = tan->next;
|
||||||
free(tan);
|
free(tan);
|
||||||
|
srvchg = TRUE;
|
||||||
}
|
}
|
||||||
ta->next = tan;
|
ta->next = tan;
|
||||||
}
|
}
|
||||||
@ -262,6 +270,7 @@ void del_router(srv_list **fap, char *name)
|
|||||||
while ((tan = ta->next) && (strcmp(tan->router, name) == 0)) {
|
while ((tan = ta->next) && (strcmp(tan->router, name) == 0)) {
|
||||||
ta->next = tan->next;
|
ta->next = tan->next;
|
||||||
free(tan);
|
free(tan);
|
||||||
|
srvchg = TRUE;
|
||||||
}
|
}
|
||||||
ta->next = tan;
|
ta->next = tan;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user