stop scanning when client disconnects in multiscan mode (bb #1417).

git-svn: trunk@4847
remotes/push_mirror/0.95
Török Edvin 17 years ago
parent 8db0a3463d
commit 3dc90d4a30
  1. 5
      ChangeLog
  2. 18
      clamd/session.c

@ -1,3 +1,8 @@
Mon Feb 23 14:10:01 EET 2009 (edwin)
------------------------------------
* clamd/session.c: stop scanning when client disconnects in
multiscan mode (bb #1417).
Sat Feb 21 21:48:43 EET 2009 (edwin)
------------------------------------
* Makefile.in, clamav-config.h.in, clamav-milter/, clamconf/,

@ -40,7 +40,9 @@
#include <sys/types.h>
#ifndef C_WINDOWS
#include <dirent.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#include <sys/socket.h>
#ifdef HAVE_FD_PASSING
#ifdef HAVE_SYS_UIO_H
@ -228,6 +230,20 @@ int command(client_conn_t *conn, int *virus)
scandata.group = group = thrmgr_group_new();
break;
case COMMAND_MULTISCANFILE:
{
fd_set rfds;
struct timeval tv;
FD_ZERO(&rfds);
FD_SET(conn->sd, &rfds);
tv.tv_sec = tv.tv_usec = 0;
if (select(conn->sd+1, &rfds, NULL, NULL, &tv) > 0 &&
FD_ISSET(conn->sd, &rfds)) {
logg("$Client disconnected while multiscan was active!\n");
thrmgr_group_terminate(conn->group);
return CL_BREAK;
}
}
thrmgr_setactivetask(NULL, "MULTISCANFILE");
scandata.group = NULL;
scandata.type = TYPE_SCAN;

Loading…
Cancel
Save