httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject Re: SIGPIPE and timeout on Solaris
Date Mon, 01 Apr 1996 18:35:47 GMT
> 
> 
> I could be missreading the code, just now trying to get familiar
> with it. It looks as if we assume that it will return a -1 if it
> fails. Never looking for EPIPE.

What is "it" in this case? Assuming it is write() then we would expect a -1
for failure. A zero return should only be possible if you either write 0 bytes
or have O_NDELAY/O_NONBLOCK set.

> 
> I've got it to at least time out by adding an abort_connection()
> call toward the end of timeout() if timeout_req. I need to 
> study this more later. The bwrite() loops in http_protocol.c if
> conn->abort is not set.

Hmmm... I'll try and take a look later.

Cheers,

Ben.

> 
> -Randy
> 
> 
> > 
> > > I think the write stuff has changed significantly with the addition
> > > of the buffered write code. One thing that seems to be a possible
> > > difference on Solaris is that write() will return a number greater
> > > than 0 on a blocked socket. This might be causing the problem.
> > > I've tried several approaches to getting this to exit the write
> > > loops with no success. I'll come back to it later.
> > 
> > 
> > It returns the number of bytes written, even if it is blocked and
> > can write part of the msg, see second point. But that makes sense.
> > 
> >  
> >           o  If O_NDELAY or O_NONBLOCK is set and the stream can-
> >             not accept data, write() returns -1 and sets errno to
> >             EAGAIN.
> >  
> >           o  If O_NDELAY or O_NONBLOCK is set  and  part  of  the
> >             buffer  has  already  been  written  when a condition
> >             occurs in which the stream cannot  accept  additional
> >             data,  write()  terminates  and returns the number of
> >             bytes written.
> > 
> > Dw.
> > 
> 

-- 
Ben Laurie                  Phone: +44 (181) 994 6435
Freelance Consultant and    Fax:   +44 (181) 994 6472
Technical Director          Email: ben@algroup.co.uk
A.L. Digital Ltd,           URL: http://www.algroup.co.uk
London, England.

Mime
View raw message