httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Behlendorf <br...@organic.com>
Subject Re: http/1.0 compliance
Date Mon, 23 Sep 1996 03:13:06 GMT

Here's my patch against the current cvs snapshot of 1.2's http_protocol.c.
Could someone double-check it before I commit?



Index: http_protocol.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_protocol.c,v
retrieving revision 1.46
diff -C3 -r1.46 http_protocol.c
*** http_protocol.c     1996/09/17 14:53:54     1.46
--- http_protocol.c     1996/09/23 03:06:41
***************
*** 369,375 ****
      if ((r->status < 200) || (r->status >= 300))
          return OK;

!     if (if_modified_since && later_than(gmtime(&mtime), if_modified_since))
          return USE_LOCAL_COPY;
      else if (if_unmodified && !later_than(gmtime(&mtime), if_unmodified))
          return PRECONDITION_FAILED;
--- 369,376 ----
      if ((r->status < 200) || (r->status >= 300))
          return OK;

!     if (if_modified_since && !r->header_only &&
!       later_than(gmtime(&mtime), if_modified_since))
          return USE_LOCAL_COPY;
      else if (if_unmodified && !later_than(gmtime(&mtime), if_unmodified))
          return PRECONDITION_FAILED;



On 19 Sep 1996, Tom Tromey wrote:
> The first problem is that a HEAD request with an If-Modified-Since
> header doesn't return the same results as an ordinary HEAD request --
> in particular the former can return 304 (not modified).
> 
> This is prohibited by this text in section 8.3:
> 
>   There is no "conditional HEAD" request analogous to the conditional
>   GET. If an If-Modified-Since header field is included with a HEAD
>   request, it should be ignored.
> 
> Appended is a patch, relative to 1.1.1, that fixes this.
> 
> Tom
> -- 
> tromey@cygnus.com                 Member, League for Programming Freedom
> 
> Index: http_protocol.c
> ===================================================================
> RCS file: /rel/cvsfiles/devo/apache/src/http_protocol.c,v
> retrieving revision 1.1.1.2
> diff -c -5 -r1.1.1.2 http_protocol.c
> *** http_protocol.c	1996/08/26 20:32:05	1.1.1.2
> --- http_protocol.c	1996/09/19 18:30:09
> ***************
> *** 202,212 ****
>   
>       /* Check for conditional GETs --- note that we only want this check
>        * to succeed if the GET was successful; ErrorDocuments *always* get sent.
>        */
>       
> !     if (r->status == 200 &&
>   	if_modified_since && later_than(gmtime(&mtime), if_modified_since))
>         
>           return USE_LOCAL_COPY;
>       else
>           return OK;
> --- 202,212 ----
>   
>       /* Check for conditional GETs --- note that we only want this check
>        * to succeed if the GET was successful; ErrorDocuments *always* get sent.
>        */
>       
> !     if (r->status == 200 && !r->header_only &&
>   	if_modified_since && later_than(gmtime(&mtime), if_modified_since))
>         
>           return USE_LOCAL_COPY;
>       else
>           return OK;
> 
> 

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com  www.apache.org  hyperreal.com  http://www.organic.com/JOBS


Mime
View raw message