wake recvloopth after SelfCheck (if set), to avoid reloading the DB

just before next scan request.

git-svn: trunk@4904
0.95
Török Edvin 16 years ago
parent 0dab32a277
commit f8e8ab4fd9
  1. 5
      ChangeLog
  2. 2
      clamd/others.c
  3. 4
      clamd/server-th.c

@ -1,3 +1,8 @@
Fri Mar 6 14:21:52 EET 2009 (edwin)
------------------------------------
* clamd/others.c, clamd/server-th.c: wake recvloopth after SelfCheck
(if set), to avoid reloading the DB just before next scan request.
Fri Mar 6 11:19:32 EET 2009 (edwin)
------------------------------------
* clamav-milter/Makefile.am, clamav-milter/Makefile.in: fix make

@ -454,7 +454,7 @@ int fds_poll_recv(struct fd_data *data, int timeout, int check_signals)
} else {
if (!closest_timeout)
closest_timeout = timeout_at;
else if (timeout_at < closest_timeout)
else if (timeout_at && timeout_at < closest_timeout)
closest_timeout = timeout_at;
}
}

@ -1042,7 +1042,7 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi
/* signal that we can accept more connections */
if (fds->nfds <= max_queue)
pthread_cond_signal(&acceptdata.cond_nfds);
new_sd = fds_poll_recv(fds, -1, 1);
new_sd = fds_poll_recv(fds, selfchk ? selfchk : -1, 1);
if (!fds->nfds) {
/* at least the dummy/sync pipe should have remained */
@ -1205,7 +1205,7 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi
/* SelfCheck */
if(selfchk) {
time(&current_time);
if((current_time - start_time) > (time_t)selfchk) {
if((current_time - start_time) >= (time_t)selfchk) {
if(reload_db(engine, dboptions, opts, TRUE, &ret)) {
pthread_mutex_lock(&reload_mutex);
reload = 1;

Loading…
Cancel
Save