K 10
svn:author
V 6
iulius
K 8
svn:date
V 27
2011-07-11T09:39:33.512711Z
K 7
svn:log
V 855
add a default timeout on outgoing sockets (NNTPconnect)

For a long time, there have been occasional problems with actsync
syncing from certain servers:  instead of erroring out and exiting (with
"cannot connect to server: Connection timed out" or alternatively
"cannot connect to server: Success"), actsync would hang until manually
killed, sometimes for days.

gdb shows actsync is hanging in a call to fgets in NNTPconnect() (from
actsync.c:get_active()).
innxmit and innxbatch can use alarm() to set a timeout but other users of
NNTPconnect, such as nntpget, rnews, clientlib.c and nnrpd/post.c
apparently don't.

Implement SO_RCVTIMEO with the default timeout of 300 seconds (set in
include/inn/options.h).

The raised error will be:
"actsync: cannot connect to server: Resource temporarily unavailable"

Thanks to Florian Schlichting for the patch.

END
