On Thu, Jan 12, 2006 at 03:46:17PM +0100, Nepenthes Development Team said:
> http://phpfi.com/95896
> thats what i'd recommend to patch this, everything else is _much_ more work.

I'm not sure that SO_RCVTIMEO is fully portable (at last the first docs
I found seem to imply it's not defined everywhere) so it might be best
just to do:

461a462,463
+       struct timeval Timeout = { 30, 0 }; // static 30 seconds receive timeout
+
583a586,592
+
+       if(setsockopt(socketfd, SOL_SOCKET, SO_RCVTIMEO, &Timeout, 
sizeof(Timeout)) < 0)
+       {
+             logg("^Can't set socket timeout on fd %i port %d of host %s (IP: 
%s) (%s)\n", socketfd, port, hostpt, ipaddr, strerror(errno));
+       }

and move on.

This will give a warning log message to alert the admin that a timeout
couldn't be set, so they know to check it periodically for problems.
The other option I suppose would be to have an autoconf maco do the
check ahead of time and #ifdef it, but it seems like more work as well.

Just thinking out loud,
-- 
 --------------------------------------------------------------------------
|  Stephen Gran                  | We don't need no education, we don't    |
|  [EMAIL PROTECTED]             | need no thought control.   -- Pink      |
|  http://www.lobefin.net/~steve | Floyd                                   |
 --------------------------------------------------------------------------

Attachment: signature.asc
Description: Digital signature

_______________________________________________
http://lurker.clamav.net/list/clamav-users.html

Reply via email to