timeout switch for actsync
julien at trigofacile.com
Fri Jun 24 18:21:50 UTC 2011
> gdb shows actsync is hanging in a call to fgets in NNTPconnect() (from
> actsync.c:get_active()). While I don't understand why fgets doesn't
> return when the TCP connection times out, looking around I found that
> innxmit and innxbatch can use alarm() to set a timeout (other users of
> NNTPconnect, such as nntpget, rnews, clientlib.c and nnrpd/post.c
> apparently don't).
> When I tried to add a switch to actsync to implement a timeout similar
> to innxmit, I found that the letters used there (-t and -T) are already
> in use for other things. So what would be a good name for a timeout
> switch for actsync? And since fgets never seems to return in certain
> cases, shouldn't the timeout be implemented for all users of
> NNTPconnect, perhaps directly in that function?
I think the best solution would be to implement the timeout directly in
NNTPconnect, around the call to fgets().
An interesting thread to read here, in case it could interest you:
fgets() returns once it receives a signal, with EINTR (interruption).
I hope fgets() has the same behaviour everywhere… :-)
« Ce n'est pas en tournant le dos aux choses qu'on leur fait face. »
More information about the inn-workers