diff --git a/ChangeLog b/ChangeLog index 5e6444ab1..7791b5cfd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Oct 14 16:06:06 CEST 2010 (acab) +------------------------------------ + * clamd: properly terminate zSTATS (bb#2286) + Thu Oct 14 15:36:06 CEST 2010 (acab) ------------------------------------ * freshclam: undefine qcompare if HAVE_GETADDRINFO is unset (bb#2289) diff --git a/clamd/session.c b/clamd/session.c index 772290cbd..650931422 100644 --- a/clamd/session.c +++ b/clamd/session.c @@ -319,7 +319,7 @@ int command(client_conn_t *conn, int *virus) thrmgr_setactivetask(NULL, "STATS"); if (conn->group) mdprintf(desc, "%u: ", conn->id); - thrmgr_printstats(desc); + thrmgr_printstats(desc, conn->term); return 0; case COMMAND_STREAM: thrmgr_setactivetask(NULL, "STREAM"); diff --git a/clamd/thrmgr.c b/clamd/thrmgr.c index b1c76141d..4c3f7936e 100644 --- a/clamd/thrmgr.c +++ b/clamd/thrmgr.c @@ -186,7 +186,7 @@ static void print_queue(int f, work_queue_t *queue, struct timeval *tv_now) (unsigned)queue->item_count); } -int thrmgr_printstats(int f) +int thrmgr_printstats(int f, char term) { struct threadpool_list *l; unsigned cnt, pool_cnt = 0; @@ -301,7 +301,7 @@ int thrmgr_printstats(int f) mdprintf(f,"MEMSTATS: heap N/A mmap N/A used N/A free N/A releasable N/A pools %u pools_used %.3fM pools_total %.3fM\n", pool_cnt, pool_used/(1024*1024.0), pool_total/(1024*1024.0)); } - mdprintf(f,"END\n"); + mdprintf(f,"END%c", term); pthread_mutex_unlock(&pools_lock); return 0; } diff --git a/clamd/thrmgr.h b/clamd/thrmgr.h index 109b4e1f8..ace1a3bf9 100644 --- a/clamd/thrmgr.h +++ b/clamd/thrmgr.h @@ -105,7 +105,7 @@ int thrmgr_group_finished(jobgroup_t *group, enum thrmgr_exit exitc); int thrmgr_group_need_terminate(jobgroup_t *group); void thrmgr_group_terminate(jobgroup_t *group); jobgroup_t *thrmgr_group_new(void); -int thrmgr_printstats(int outfd); +int thrmgr_printstats(int outfd, char term); void thrmgr_setactivetask(const char *filename, const char* command); void thrmgr_setactiveengine(const struct cl_engine *engine);