git-svn: trunk@1585
Tomasz Kojm authored on 2005/05/26 11:07:12... | ... |
@@ -1,3 +1,9 @@ |
1 |
+Thu May 26 04:03:31 CEST 2005 (tk) |
|
2 |
+---------------------------------- |
|
3 |
+ * clamd/scanner.c: quick recovery of thread resources when clamd clients |
|
4 |
+ abandon stream connection requests (patch by Mark |
|
5 |
+ Pizzolato <clamav-devel*subscriptions.pizzolato.net>) |
|
6 |
+ |
|
1 | 7 |
Thu May 26 03:20:44 CEST 2005 (tk) |
2 | 8 |
---------------------------------- |
3 | 9 |
* libclamav/others.c: print warnings and errors in single call to write |
... | ... |
@@ -380,7 +380,11 @@ int scanstream(int odesc, unsigned long int *scanned, const struct cl_node *root |
380 | 380 |
return -1; |
381 | 381 |
} else { |
382 | 382 |
listen(sockfd, 1); |
383 |
- mdprintf(odesc, "PORT %d\n", port); |
|
383 |
+ if(mdprintf(odesc, "PORT %d\n", port) <= 0) { |
|
384 |
+ logg("!ScanStream: error transmitting port.\n"); |
|
385 |
+ close(sockfd); |
|
386 |
+ return -1; |
|
387 |
+ } |
|
384 | 388 |
} |
385 | 389 |
|
386 | 390 |
switch(retval = poll_fd(sockfd, timeout)) { |
... | ... |
@@ -478,11 +482,11 @@ int scanstream(int odesc, unsigned long int *scanned, const struct cl_node *root |
478 | 478 |
virusaction("stream", virname, copt); |
479 | 479 |
} else if(ret != CL_CLEAN) { |
480 | 480 |
mdprintf(odesc, "stream: %s ERROR\n", cl_strerror(ret)); |
481 |
- logg("stream: %s ERROR\n", cl_strerror(ret)); |
|
481 |
+ logg("stream %d: %s ERROR\n", port, cl_strerror(ret)); |
|
482 | 482 |
} else { |
483 | 483 |
mdprintf(odesc, "stream: OK\n"); |
484 | 484 |
if(logok) |
485 |
- logg("stream: OK\n"); |
|
485 |
+ logg("stream %d: OK\n", port); |
|
486 | 486 |
} |
487 | 487 |
|
488 | 488 |
return ret; |