state-threads
[Top] [All Lists]

RE: Proxy failure on ECONNABORTED

To: "'Gene Shekhtman'" <genes@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: Proxy failure on ECONNABORTED
From: "Kiernan, Alex" <alexk@xxxxxxxxx>
Date: Thu, 14 Sep 2000 06:15:43 +0100
Cc: "'state-threads@xxxxxxxxxxx'" <state-threads@xxxxxxxxxxx>
Sender: owner-state-threads@xxxxxxxxxxx
> > My immediate reaction was to change
> >
> >     if (errno == EINTR)
> >
> > to
> >
> >     if (errno == EINTR || errno == ECONNABORTED)
> >
> > in st_accept(), but I'm not convinced thats the right fix 
> (OK it needs some
> > ifdefing around it, but I was thinking more of where this 
> is "the right
> > fix").
> >
> 
> I think that applications should deal with those types of 
> errors and not the
> library.  That is, you need to modify proxy.c (which is just 
> an example)
> to handle ECONNABORTED the way you want it.  Something along 
> the lines:
> 
> ....
>     cli_nfd = st_accept(srv_nfd, (struct sockaddr 
> *)&cli_addr, &n, -1);
>     if (cli_nfd == NULL) {
>       /* Ignore ECONNABORTED */
>       if (errno == ECONNABORTED)
>         continue;
>       print_sys_error("st_accept");
>       exit(1);
>     }
> ....
> 
> In other words, treat st_accept() the same way as accept(3).
> 

Thanks, that was the steer I needed.

-- 
Alex Kiernan, Principal Engineer, Development, Thus PLC

<Prev in Thread] Current Thread [Next in Thread>