httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@apache.org
Subject cvs commit: httpd-2.0/modules/experimental mod_disk_cache.c
Date Wed, 03 Apr 2002 21:26:36 GMT
stoddard    02/04/03 13:26:36

  Modified:    modules/experimental mod_disk_cache.c
  Log:
  Fix a couple of edge cases when the content being cached is generated locally.
  (ie, the HTTP_HEADER_FILTER has not yet run)
  
  Revision  Changes    Path
  1.32      +11 -0     httpd-2.0/modules/experimental/mod_disk_cache.c
  
  Index: mod_disk_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_disk_cache.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- mod_disk_cache.c	3 Apr 2002 17:34:01 -0000	1.31
  +++ mod_disk_cache.c	3 Apr 2002 21:26:35 -0000	1.32
  @@ -570,11 +570,22 @@
               buf = apr_pstrcat(r->pool, CRLF, NULL);
               amt = strlen(buf);
               apr_file_write(hfd, buf, &amt);
  +            
  +            /* This case only occurs when the content is generated locally */
  +            if (!apr_table_get(r->headers_out, "Content-Type") && r->content_type)
{
  +                apr_table_setn(r->headers_out, "Content-Type", 
  +                               ap_make_content_type(r, r->content_type));
  +            }
           }
           sprintf(statusbuf,"%d", r->status);
           buf = apr_pstrcat(r->pool, statusbuf, CRLF, NULL);
           amt = strlen(buf);
           apr_file_write(hfd, buf, &amt);
  +
  +        /* This case only occurs when the content is generated locally */
  +        if (!r->status_line) {
  +            r->status_line = ap_get_status_line(r->status);
  +        }
           buf = apr_pstrcat(r->pool, r->status_line, "\n", NULL);
           amt = strlen(buf);
           apr_file_write(hfd, buf, &amt);
  
  
  

Mime
View raw message