disable timeout when ReadTimeout=0

git-svn: trunk@451
remotes/push_mirror/metadata
Trog 21 years ago
parent 1e35d8076e
commit 5b9ac68dfc
  1. 4
      clamav-devel/ChangeLog
  2. 8
      clamav-devel/clamd/others.c
  3. 3
      clamav-devel/clamd/scanner.c
  4. 5
      clamav-devel/clamd/session.c

@ -1,3 +1,7 @@
Mon Mar 29 16:17:05 BST 2004 (trog)
-----------------------------------
* clamd: disable timeout when ReadTimeout=0
Mon Mar 29 15:45:15 BST 2004 (trog)
-----------------------------------
* clamd: add support for ReadTimeout option

@ -98,8 +98,11 @@ int poll_fd(int fd, int timeout_sec)
poll_data[0].events = POLLIN;
poll_data[0].revents = 0;
if (timeout_sec > 0) {
timeout_sec *= 1000;
}
while (1) {
retval = poll(poll_data, 1, timeout_sec*1000);
retval = poll(poll_data, 1, timeout_sec);
if (retval == -1) {
if (errno == EINTR) {
continue;
@ -123,7 +126,8 @@ int poll_fd(int fd, int timeout_sec)
tv.tv_sec = timeout_sec;
tv.tv_usec = 0;
retval = select(fd+1, &rfds, NULL, NULL, &tv);
retval = select(fd+1, &rfds, NULL, NULL,
(timeout_sec>0 ? &tv : NULL));
if (retval == -1) {
if (errno == EINTR) {
continue;

@ -227,6 +227,9 @@ int scanstream(int odesc, unsigned long int *scanned, const struct cl_node *root
} else {
timeout = CL_DEFAULT_SCANTIMEOUT;
}
if (timeout == 0) {
timeout = -1;
}
if(!bound && !portscan) {
mdprintf(odesc, "ERROR\n");

@ -67,7 +67,10 @@ int command(int desc, const struct cl_node *root, const struct cl_limits *limits
} else {
timeout = CL_DEFAULT_SCANTIMEOUT;
}
if (timeout == 0) {
timeout = -1;
}
retval = poll_fd(desc, timeout);
switch (retval) {
case 0: /* timeout */

Loading…
Cancel
Save