extern int relative_pid; /* process id starting at 1 */
extern int actconn; /* # of active sessions */
extern int listeners;
-extern int jobs; /* # of active jobs */
+extern int jobs; /* # of active jobs (listeners, sessions, open devices) */
extern struct chunk trash;
extern int nb_oldpids; /* contains the number of old pids found */
extern const int zero;
/* Delete a listener from its protocol's list of listeners. The listener's
* state is automatically updated from LI_ASSIGNED to LI_INIT. The protocol's
- * number of listeners is updated. Note that the listener must have previously
- * been unbound. This is the generic function to use to remove a listener.
+ * number of listeners is updated, as well as the global number of listeners
+ * and jobs. Note that the listener must have previously been unbound. This
+ * is the generic function to use to remove a listener.
*/
void delete_listener(struct listener *listener)
{
listener->state = LI_INIT;
LIST_DEL(&listener->proto_list);
listener->proto->nb_listeners--;
+ listeners--;
+ jobs--;
}
/* This function is called on a read event from a listening socket, corresponding
unbind_listener_no_close(l);
if (l->state >= LI_ASSIGNED) {
delete_listener(l);
- listeners--;
- jobs--;
}
/*
* Pretend we're still up and running so that the fd
unbind_listener(l);
if (l->state >= LI_ASSIGNED) {
delete_listener(l);
- listeners--;
- jobs--;
}
}
p->state = PR_STSTOPPED;