cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: again: connect() timeouts

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 26 Oct 2000 23:55:36 +0200 (MET DST)

On Thu, 26 Oct 2000, Georg Horn wrote:

> i further investigated the problem with hanging connect() calls and the
> alarm() timer. When installing a signal handler with the signal()
> function, which is just a wrapper around sigaction(), signals are handled
> in such a matter that syscalls are restarted after the signal handler has
> finished. So we stay in the connect(), that hangs for minutes if a server
> is unreachable.
>
> But when we use sigaction() directly, we can specify via a flag that
> syscalls should no be restarted, and then the connect() returns with
> ernno set to EINTR after the alarm signal. So what about the following
> patch?

I'm amazed!

You've really lit up my day! ;-) Thanks a lot for digging down into this and
solving it beautifully.

I just added a few '#ifdef HAVE_SIGACTION' lines to maintain portability, but
otherwise your patch is applied as you posted it.

That makes your perl scripts a lot fancier, doesn't it?

-- 
  Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
Received on 2000-10-26