httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <ra...@zyzzyva.com>
Subject Re: SIGPIPE and timeout on Solaris (solved apparently)
Date Tue, 02 Apr 1996 12:58:05 GMT
> > 
> > 
> > I made the following change to http_protocol.c and it seems to
> > have fixed the problem. Could someone give me a one liner on
> > how to commit this, and give me commit permissions?
> 
> This patch is wrong. It is not correct to check errno unless you have already
> seen an error return. I would suggest a simple "if(w <= 0) break;" instead.
> Of course, the following code should deal with the matter appropriately, too.

How about the following. None of the other patches I have seen
for this piece of code will actually break the loop if the
write actually fails. The formating is strange since formating
in the rest of the routine is different than my Emacs want's it
to be. 

*** http_protocol.c.orig	Tue Apr  2 06:48:41 1996
--- http_protocol.c	Tue Apr  2 06:53:50 1996
***************
*** 718,730 ****
          o=0;
  	total_bytes_sent += n;
  	
!         while(n && !r->connection->aborted) {
!             w=bwrite(c->client, &buf[o], n);
! 	    if (w)
! 	        reset_timeout(r); /* reset timeout after successfule write */
!             n-=w;
!             o+=w;
!         }
      }
      bflush(c->client);
      
--- 718,733 ----
          o=0;
  	total_bytes_sent += n;
  	
! 	while(n && !r->connection->aborted) {
! 	    w=bwrite(c->client, &buf[o], n);
! 	    if (w > 0) {
! 		reset_timeout(r); /* reset timeout after successfule write */
! 		n-=w;
! 		o+=w;
! 	    }
! 	    else
! 		break;
! 	}
      }
      bflush(c->client);
      



Mime
View raw message