Browse code

properly handle ReadTimeout in SESSION

git-svn: trunk@1744

Tomasz Kojm authored on 2005/11/04 07:05:35
Showing 4 changed files
... ...
@@ -1,3 +1,8 @@
1
+Thu Nov  3 23:04:20 CET 2005 (tk)
2
+---------------------------------
3
+  * clamd: properly handle ReadTimeout in SESSION
4
+	   Bug reported by Kamil Kaczkowski <kamil*kamil.eisp.pl>
5
+
1 6
 Thu Nov  3 22:46:21 CET 2005 (tk)
2 7
 ---------------------------------
3 8
   * libclamav/mspack/cabd.c: fix possible infinite loop in cabd_find
... ...
@@ -81,7 +81,7 @@ void scanner_thread(void *arg)
81 81
 
82 82
     do {
83 83
     	ret = command(conn->sd, conn->root, conn->limits, conn->options, conn->copt, timeout);
84
-	if (ret == -1) {
84
+	if (ret < 0) {
85 85
 		break;
86 86
 	}
87 87
 
... ...
@@ -55,7 +55,7 @@ int command(int desc, const struct cl_node *root, const struct cl_limits *limits
55 55
     retval = poll_fd(desc, timeout);
56 56
     switch (retval) {
57 57
     case 0: /* timeout */
58
-	return COMMAND_TIMEOUT;
58
+	return -2;
59 59
     case -1:
60 60
 	mdprintf(desc, "ERROR\n");
61 61
 	logg("!Command: poll_fd failed.\n");
... ...
@@ -23,7 +23,6 @@
23 23
 #define COMMAND_RELOAD 2
24 24
 #define COMMAND_END 3
25 25
 #define COMMAND_SESSION 4
26
-#define COMMAND_TIMEOUT 5
27 26
 
28 27
 #define CMD1 "SCAN"
29 28
 #define CMD2 "RAWSCAN"