You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ICS.UCI.EDU> on 1997/06/30 23:17:20 UTC

Re: [STATUS] 1.2.1, final(?) snapshot available

I was meaning to do this for 1.2.1, but couldn't find the time til now.
One of the problems that cropped up around 1.2b10 is that we need a way for
the server to know that the current request's message body has been
read, in order to avoid having later subrequests or internal redirects
attempt to read it again (and block).  I didn't do it then because I
did not want to change anything that required a new magic module number.
Since the API has already changed for 1.2.1, this should be included now.

....Roy


Index: httpd.h
===================================================================
RCS file: /export/home/cvs/apache/src/httpd.h,v
retrieving revision 1.119
diff -c -r1.119 httpd.h
*** httpd.h	1997/06/29 19:19:36	1.119
--- httpd.h	1997/06/30 21:20:27
***************
*** 487,492 ****
--- 487,493 ----
    long read_length;		/* bytes that have been read */
    int read_body;   		/* how the request body should be read */
    int read_chunked;		/* reading chunked transfer-coding */
+   int have_read_body;   	/* false (0) until first get_client_block */
  
    /* MIME header environments, in and out.  Also, an array containing
     * environment variables to be passed to subprocesses, so people can
Index: http_protocol.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_protocol.c,v
retrieving revision 1.129
diff -c -r1.129 http_protocol.c
*** http_protocol.c	1997/06/29 17:56:47	1.129
--- http_protocol.c	1997/06/30 21:20:28
***************
*** 1348,1354 ****
  
  int should_client_block (request_rec *r)
  {
!     if (is_HTTP_ERROR(r->status))
          return 0;
  
      if (!r->read_chunked && (r->remaining <= 0))
--- 1348,1354 ----
  
  int should_client_block (request_rec *r)
  {
!     if (r->have_read_body || is_HTTP_ERROR(r->status))
          return 0;
  
      if (!r->read_chunked && (r->remaining <= 0))
***************
*** 1399,1404 ****
--- 1399,1406 ----
      int c;
      long len_read, len_to_read;
      long chunk_start = 0;
+ 
+     r->have_read_body = 1;
  
      if (!r->read_chunked) {                 /* Content-length read */
          len_to_read = (r->remaining > bufsiz) ? bufsiz : r->remaining;

Re: [STATUS] 1.2.1, final(?) snapshot available

Posted by Marc Slemko <ma...@worldgate.com>.
On Mon, 30 Jun 1997, Dean Gaudet wrote:

> I cave in too easily, I wanted to stop changes on 1.2.1 yesterday.  But
> I'm happy including this and Marc's PR#333 patch.  They seem inocuous
> enough ;)  I suppose this means I shouldn't roll 1.2.1 final today, and
> should hold the announcement off until wednesday.

Yes, and give a day or two after rolling what is hopefully 1.2.1 before
putting it on the website or announcing it... want to verify that it
works.

> 
> snap3 coming up. 
> 
> Dean
> 
> On Mon, 30 Jun 1997, Roy T. Fielding wrote:
> 
> > I was meaning to do this for 1.2.1, but couldn't find the time til now.
> > One of the problems that cropped up around 1.2b10 is that we need a way for
> > the server to know that the current request's message body has been
> > read, in order to avoid having later subrequests or internal redirects
> > attempt to read it again (and block).  I didn't do it then because I
> > did not want to change anything that required a new magic module number.
> > Since the API has already changed for 1.2.1, this should be included now.
> > 
> > ....Roy
> > 
> > 
> > Index: httpd.h
> > ===================================================================
> > RCS file: /export/home/cvs/apache/src/httpd.h,v
> > retrieving revision 1.119
> > diff -c -r1.119 httpd.h
> > *** httpd.h	1997/06/29 19:19:36	1.119
> > --- httpd.h	1997/06/30 21:20:27
> > ***************
> > *** 487,492 ****
> > --- 487,493 ----
> >     long read_length;		/* bytes that have been read */
> >     int read_body;   		/* how the request body should be read */
> >     int read_chunked;		/* reading chunked transfer-coding */
> > +   int have_read_body;   	/* false (0) until first get_client_block */
> >   
> >     /* MIME header environments, in and out.  Also, an array containing
> >      * environment variables to be passed to subprocesses, so people can
> > Index: http_protocol.c
> > ===================================================================
> > RCS file: /export/home/cvs/apache/src/http_protocol.c,v
> > retrieving revision 1.129
> > diff -c -r1.129 http_protocol.c
> > *** http_protocol.c	1997/06/29 17:56:47	1.129
> > --- http_protocol.c	1997/06/30 21:20:28
> > ***************
> > *** 1348,1354 ****
> >   
> >   int should_client_block (request_rec *r)
> >   {
> > !     if (is_HTTP_ERROR(r->status))
> >           return 0;
> >   
> >       if (!r->read_chunked && (r->remaining <= 0))
> > --- 1348,1354 ----
> >   
> >   int should_client_block (request_rec *r)
> >   {
> > !     if (r->have_read_body || is_HTTP_ERROR(r->status))
> >           return 0;
> >   
> >       if (!r->read_chunked && (r->remaining <= 0))
> > ***************
> > *** 1399,1404 ****
> > --- 1399,1406 ----
> >       int c;
> >       long len_read, len_to_read;
> >       long chunk_start = 0;
> > + 
> > +     r->have_read_body = 1;
> >   
> >       if (!r->read_chunked) {                 /* Content-length read */
> >           len_to_read = (r->remaining > bufsiz) ? bufsiz : r->remaining;
> > 
> 


Re: [STATUS] 1.2.1, final(?) snapshot available

Posted by Alexei Kosut <ak...@organic.com>.
On Mon, 30 Jun 1997, Dean Gaudet wrote:

> I cave in too easily, I wanted to stop changes on 1.2.1 yesterday.  But
> I'm happy including this and Marc's PR#333 patch.  They seem inocuous
> enough ;)  I suppose this means I shouldn't roll 1.2.1 final today, and
> should hold the announcement off until wednesday.

Sure. +1 on Roy's patch *if* there is a comment added indicating that
have_read_body only means that the incoming body has been begun to be
read; it does not mean that the entire body has been read. Otherwise,
someone a few months from now might inadvertantly assume that just because
have_read_body is set, there is no incoming body left. This could be
dangerous, especially with persistent connections (and is the reason that
we don't keep non-GET requests alive if they fail somehow).

-- Alexei Kosut <ak...@organic.com>


Re: [STATUS] 1.2.1, final(?) snapshot available

Posted by Dean Gaudet <dg...@arctic.org>.
I cave in too easily, I wanted to stop changes on 1.2.1 yesterday.  But
I'm happy including this and Marc's PR#333 patch.  They seem inocuous
enough ;)  I suppose this means I shouldn't roll 1.2.1 final today, and
should hold the announcement off until wednesday.

snap3 coming up. 

Dean

On Mon, 30 Jun 1997, Roy T. Fielding wrote:

> I was meaning to do this for 1.2.1, but couldn't find the time til now.
> One of the problems that cropped up around 1.2b10 is that we need a way for
> the server to know that the current request's message body has been
> read, in order to avoid having later subrequests or internal redirects
> attempt to read it again (and block).  I didn't do it then because I
> did not want to change anything that required a new magic module number.
> Since the API has already changed for 1.2.1, this should be included now.
> 
> ....Roy
> 
> 
> Index: httpd.h
> ===================================================================
> RCS file: /export/home/cvs/apache/src/httpd.h,v
> retrieving revision 1.119
> diff -c -r1.119 httpd.h
> *** httpd.h	1997/06/29 19:19:36	1.119
> --- httpd.h	1997/06/30 21:20:27
> ***************
> *** 487,492 ****
> --- 487,493 ----
>     long read_length;		/* bytes that have been read */
>     int read_body;   		/* how the request body should be read */
>     int read_chunked;		/* reading chunked transfer-coding */
> +   int have_read_body;   	/* false (0) until first get_client_block */
>   
>     /* MIME header environments, in and out.  Also, an array containing
>      * environment variables to be passed to subprocesses, so people can
> Index: http_protocol.c
> ===================================================================
> RCS file: /export/home/cvs/apache/src/http_protocol.c,v
> retrieving revision 1.129
> diff -c -r1.129 http_protocol.c
> *** http_protocol.c	1997/06/29 17:56:47	1.129
> --- http_protocol.c	1997/06/30 21:20:28
> ***************
> *** 1348,1354 ****
>   
>   int should_client_block (request_rec *r)
>   {
> !     if (is_HTTP_ERROR(r->status))
>           return 0;
>   
>       if (!r->read_chunked && (r->remaining <= 0))
> --- 1348,1354 ----
>   
>   int should_client_block (request_rec *r)
>   {
> !     if (r->have_read_body || is_HTTP_ERROR(r->status))
>           return 0;
>   
>       if (!r->read_chunked && (r->remaining <= 0))
> ***************
> *** 1399,1404 ****
> --- 1399,1406 ----
>       int c;
>       long len_read, len_to_read;
>       long chunk_start = 0;
> + 
> +     r->have_read_body = 1;
>   
>       if (!r->read_chunked) {                 /* Content-length read */
>           len_to_read = (r->remaining > bufsiz) ? bufsiz : r->remaining;
>