httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: httpd-2.0/modules/generators mod_autoindex.c
Date Fri, 05 Apr 2002 17:50:37 GMT
rbb         02/04/05 09:50:37

  Modified:    modules/generators mod_autoindex.c
  Log:
  This is a HACK!  The problem is that the fast_internal_redirect is
  removing the OLD_WRITE filter. Obviously that is wrong.  For right now,
  the fix is to hack around the problem and just make it work.  Long term,
  we need to find a real solution to this, but this gets autoindex working
  today.
  
  Revision  Changes    Path
  1.103     +25 -1     httpd-2.0/modules/generators/mod_autoindex.c
  
  Index: mod_autoindex.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_autoindex.c,v
  retrieving revision 1.102
  retrieving revision 1.103
  diff -u -r1.102 -r1.103
  --- mod_autoindex.c	20 Mar 2002 17:41:54 -0000	1.102
  +++ mod_autoindex.c	5 Apr 2002 17:50:37 -0000	1.103
  @@ -1000,6 +1000,7 @@
       apr_table_setn(hdrs, "Accept", "text/html, text/plain");
       apr_table_unset(hdrs, "Accept-Encoding");
   
  +
       if ((header_fname != NULL) && r->args) {
           header_fname = apr_pstrcat(r->pool, header_fname, "?", r->args, NULL);
       }
  @@ -1017,13 +1018,30 @@
           if (rr->content_type != NULL) {
               if (!strcasecmp(ap_field_noparam(r->pool, rr->content_type),
                               "text/html")) {
  -                /* Hope everything will work... */
  +                ap_filter_t *f;
  +               /* Hope everything will work... */
                   emit_amble = 0;
                   emit_H1 = 0;
   
                   if (! suppress_amble) {
                       emit_preamble(r, title);
                   }
  +                /* This is a hack, but I can't find any better way to do this.
  +                 * The problem is that we have already created the sub-request,
  +                 * but we just inserted the OLD_WRITE filter, and the 
  +                 * sub-request needs to pass its data through the OLD_WRITE
  +                 * filter, or things go horribly wrong (missing data, data in
  +                 * the wrong order, etc).  To fix it, if you create a 
  +                 * sub-request and then insert the OLD_WRITE filter before you
  +                 * run the request, you need to make sure that the sub-request
  +                 * data goes through the OLD_WRITE filter.  Just steal this 
  +                 * code.  The long-term solution is to remove the ap_r*
  +                 * functions.
  +                 */
  +                for (f=rr->output_filters; 
  +                     f->frec != ap_subreq_core_filter_handle; f = f->next);
  +                f->next = r->output_filters; 
  +
                   /*
                    * If there's a problem running the subrequest, display the
                    * preamble if we didn't do it before -- the header file
  @@ -1111,6 +1129,12 @@
           if (rr->content_type != NULL) {
               if (!strcasecmp(ap_field_noparam(r->pool, rr->content_type),
                               "text/html")) {
  +                ap_filter_t *f;
  +                for (f=rr->output_filters; 
  +                     f->frec != ap_subreq_core_filter_handle; f = f->next);
  +                f->next = r->output_filters; 
  +
  +
                   if (ap_run_sub_req(rr) == OK) {
                       /* worked... */
                       suppress_sig = 1;
  
  
  

Mime
View raw message