... | ... |
@@ -434,8 +434,8 @@ int main(int argc, char **argv) |
434 | 434 |
logg("#Not loading PUA signatures.\n"); |
435 | 435 |
} |
436 | 436 |
|
437 |
- if (optget(opts, "StatsDisabled")->enabled) { |
|
438 |
- cl_engine_set_clcb_stats_add_sample(engine, NULL); |
|
437 |
+ if (optget(opts, "StatsEnabled")->enabled) { |
|
438 |
+ cl_engine_stats_enable(engine); |
|
439 | 439 |
} |
440 | 440 |
|
441 | 441 |
if (optget(opts, "StatsPEDisabled")->enabled) { |
... | ... |
@@ -582,8 +582,8 @@ int scanmanager(const struct optstruct *opts) |
582 | 582 |
cl_engine_set_num(engine, CL_ENGINE_DISABLE_PE_STATS, 1); |
583 | 583 |
} |
584 | 584 |
|
585 |
- if (optget(opts, "disable-stats")->enabled) { |
|
586 |
- cl_engine_set_clcb_stats_add_sample(engine, NULL); |
|
585 |
+ if (optget(opts, "enable-stats")->enabled) { |
|
586 |
+ cl_engine_stats_enable(engine); |
|
587 | 587 |
} |
588 | 588 |
|
589 | 589 |
if (optget(opts, "stats-timeout")->enabled) { |
... | ... |
@@ -398,6 +398,8 @@ extern void cl_engine_set_clcb_stats_get_size(struct cl_engine *engine, clcb_sta |
398 | 398 |
typedef char * (*clcb_stats_get_hostid)(void *cbdata); |
399 | 399 |
extern void cl_engine_set_clcb_stats_get_hostid(struct cl_engine *engine, clcb_stats_get_hostid callback); |
400 | 400 |
|
401 |
+extern void cl_engine_stats_enable(struct cl_engine *engine); |
|
402 |
+ |
|
401 | 403 |
struct cl_stat { |
402 | 404 |
char *dir; |
403 | 405 |
STATBUF *stattab; |
... | ... |
@@ -672,3 +672,9 @@ void cl_engine_set_clcb_stats_get_hostid(struct cl_engine *engine, clcb_stats_ge |
672 | 672 |
{ |
673 | 673 |
engine->cb_stats_get_hostid = callback; |
674 | 674 |
} |
675 |
+ |
|
676 |
+void cl_engine_stats_enable(struct cl_engine *engine) |
|
677 |
+{ |
|
678 |
+ engine->cb_stats_add_sample = clamav_stats_add_sample; |
|
679 |
+ engine->cb_stats_submit = clamav_stats_submit; |
|
680 |
+} |
... | ... |
@@ -186,7 +186,7 @@ const struct clam_option __clam_options[] = { |
186 | 186 |
|
187 | 187 |
{ "StatsHostID", "stats-host-id", 0, TYPE_STRING, NULL, -1, NULL, 0, OPT_FRESHCLAM | OPT_CLAMD | OPT_CLAMSCAN, "HostID in the form of an UUID to use when submitting statistical information. See the clamscan manpage for more information.", "default" }, |
188 | 188 |
|
189 |
- { "StatsDisabled", "disable-stats", 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_CLAMSCAN, "Disable submission of statistical data", "no" }, |
|
189 |
+ { "StatsEnabled", "enable-stats", 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_CLAMSCAN, "Enable submission of statistical data", "yes" }, |
|
190 | 190 |
|
191 | 191 |
{ "StatsPEDisabled", "disable-pe-stats", 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_CLAMSCAN, "Disable submission of PE section statistical data", "no" }, |
192 | 192 |
|