/* If there's still data to process, wait 2 seconds first */
if (DBufLength(&(cli_recvQ(cptr))) && !NoNewLine(cptr) &&
- !(cli_freeflag(cptr) & FREEFLAG_TIMER)) {
+ !t_onqueue(&(cli_proc(cptr)))) {
Debug((DEBUG_LIST, "Adding client process timer for %C", cptr));
cli_freeflag(cptr) |= FREEFLAG_TIMER;
timer_add(&(cli_proc(cptr)), client_timer_callback, cli_connect(cptr),
assert(0 == cptr || con == cli_connect(cptr));
- con_freeflag(con) &= ~FREEFLAG_TIMER; /* timer has expired... */
-
if (ev_type(ev)== ET_DESTROY) {
+ con_freeflag(con) &= ~FREEFLAG_TIMER; /* timer has expired... */
+
if (!con_freeflag(con) && !cptr)
free_connection(con); /* client is being destroyed */
} else {