Browse code

bb#2286

aCaB authored on 2010/10/14 23:06:43
Showing 4 changed files
... ...
@@ -1,3 +1,7 @@
1
+Thu Oct 14 16:06:06 CEST 2010 (acab)
2
+------------------------------------
3
+ * clamd: properly terminate zSTATS (bb#2286)
4
+
1 5
 Thu Oct 14 15:36:06 CEST 2010 (acab)
2 6
 ------------------------------------
3 7
  * freshclam: undefine qcompare if HAVE_GETADDRINFO is unset (bb#2289)
... ...
@@ -319,7 +319,7 @@ int command(client_conn_t *conn, int *virus)
319 319
 	    thrmgr_setactivetask(NULL, "STATS");
320 320
 	    if (conn->group)
321 321
 		mdprintf(desc, "%u: ", conn->id);
322
-	    thrmgr_printstats(desc);
322
+	    thrmgr_printstats(desc, conn->term);
323 323
 	    return 0;
324 324
 	case COMMAND_STREAM:
325 325
 	    thrmgr_setactivetask(NULL, "STREAM");
... ...
@@ -186,7 +186,7 @@ static void print_queue(int f, work_queue_t *queue, struct timeval *tv_now)
186 186
 		 (unsigned)queue->item_count);
187 187
 }
188 188
 
189
-int thrmgr_printstats(int f)
189
+int thrmgr_printstats(int f, char term)
190 190
 {
191 191
 	struct threadpool_list *l;
192 192
 	unsigned cnt, pool_cnt = 0;
... ...
@@ -301,7 +301,7 @@ int thrmgr_printstats(int f)
301 301
 		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",
302 302
 			 pool_cnt, pool_used/(1024*1024.0), pool_total/(1024*1024.0));
303 303
 	}
304
-	mdprintf(f,"END\n");
304
+	mdprintf(f,"END%c", term);
305 305
 	pthread_mutex_unlock(&pools_lock);
306 306
 	return 0;
307 307
 }
... ...
@@ -105,7 +105,7 @@ int thrmgr_group_finished(jobgroup_t *group, enum thrmgr_exit exitc);
105 105
 int thrmgr_group_need_terminate(jobgroup_t *group);
106 106
 void thrmgr_group_terminate(jobgroup_t *group);
107 107
 jobgroup_t *thrmgr_group_new(void);
108
-int thrmgr_printstats(int outfd);
108
+int thrmgr_printstats(int outfd, char term);
109 109
 void thrmgr_setactivetask(const char *filename, const char* command);
110 110
 void thrmgr_setactiveengine(const struct cl_engine *engine);
111 111