Add functions to set the stats callbacks. Don't submit stats when verifying CVDs.

remotes/push_mirror/0.98.2
Shawn Webb 12 years ago
parent 542d85184f
commit 7c92a662d9
  1. 1
      freshclam/manager.c
  2. 1
      libclamav/cvd.c
  3. 45
      libclamav/stats.c

@ -1784,6 +1784,7 @@ test_database (const char *newfile, const char *newdb, int bytecode)
{
return FCE_TESTFAIL;
}
cl_engine_set_clcb_stats_submit(engine, NULL);
if ((ret =
cl_load (newfile, engine, &newsigs,

@ -567,6 +567,7 @@ int cl_cvdverify(const char *file)
fclose(fs);
return CL_EMEM;
}
engine->cb_stats_submit = NULL; /* Don't submit stats if we're just verifying a CVD */
ret = cli_cvdload(fs, engine, NULL, CL_DB_STDOPT | CL_DB_PUA, !!cli_strbcasestr(file, ".cld"), file, 1);

@ -461,3 +461,48 @@ static cli_flagged_sample_t *find_sample(cli_intel_t *intel, const char *virname
return NULL;
}
void cl_engine_set_clcb_stats_submit(struct cl_engine *engine, clcb_stats_submit callback)
{
engine->cb_stats_submit = callback;
}
void cl_engine_stats_set_cbdata(struct cl_engine *engine, void *cbdata)
{
engine->stats_data = cbdata;
}
void cl_engine_set_clcb_stats_add_sample(struct cl_engine *engine, clcb_stats_add_sample callback)
{
engine->cb_stats_add_sample = callback;
}
void cl_engine_set_clcb_stats_remove_sample(struct cl_engine *engine, clcb_stats_remove_sample callback)
{
engine->cb_stats_remove_sample = callback;
}
void cl_engine_set_clcb_stats_decrement_count(struct cl_engine *engine, clcb_stats_decrement_count callback)
{
engine->cb_stats_decrement_count = callback;
}
void cl_engine_set_clcb_stats_flush(struct cl_engine *engine, clcb_stats_flush callback)
{
engine->cb_stats_flush = callback;
}
void cl_engine_set_clcb_stats_get_num(struct cl_engine *engine, clcb_stats_get_num callback)
{
engine->cb_stats_get_num = callback;
}
void cl_engine_set_clcb_stats_get_size(struct cl_engine *engine, clcb_stats_get_size callback)
{
engine->cb_stats_get_size = callback;
}
void cl_engine_set_clcb_stats_get_hostid(struct cl_engine *engine, clcb_stats_get_hostid callback)
{
engine->cb_stats_get_hostid = callback;
}

Loading…
Cancel
Save