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/server util_filter.c
Date Sun, 03 Mar 2002 06:04:08 GMT
rbb         02/03/02 22:04:08

  Modified:    .        STATUS
               include  util_filter.h
               server   util_filter.c
  Log:
  This finishes the mod_dir/mod_negotiation bug.  This final part of the
  solution ensures that we don't lose filters if they are added later than
  we expect.  The problem could be seen if a connection filter was added
  after a request-based filter was added in the past.  The problem was that
  the request-based filters pointed to the first filter in the connection
  record, so the new connection filter was never called.  Now, all filters
  are put on their correct filter lists, and we are sure to always update
  all pointers when adding a filter.
  
  Revision  Changes    Path
  1.536     +1 -14     httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.535
  retrieving revision 1.536
  diff -u -r1.535 -r1.536
  --- STATUS	2 Mar 2002 19:10:07 -0000	1.535
  +++ STATUS	3 Mar 2002 06:04:08 -0000	1.536
  @@ -1,5 +1,5 @@
   APACHE 2.0 STATUS:                                              -*-text-*-
  -Last modified at [$Date: 2002/03/02 19:10:07 $]
  +Last modified at [$Date: 2002/03/03 06:04:08 $]
   
   Release:
   
  @@ -49,19 +49,6 @@
                    (Note: Win32 had its .32 yanked due to a mmap() bug.)
   
   FINAL RELEASE SHOWSTOPPERS:
  -
  -    * All ap_internal_fast_redirect()ed requests are losing their filters
  -      and output headers.  mod_negotiation derived Multiviewed documents
  -      and mod_dir DirectoryIndex documents both demonstrate this behavior.
  -      [PR 9963, 10001]
  -        cf reply:  <007c01c1b3d1$46714650$94c0b0d0@v505>
  -        to thread: <200202121332.IAA27467@web.turner.com>
  -      Solutions:
  -        Ditch fast_redirect, it was bogus in 1.3 and it's bogus now.
  -          In Agreement? : Justin, Aaron
  -        Fix [and *Maintain*] fast_redirect, it was useful to our redirects
  -        in negotiation and dir, and it's useful to 3rd parties.
  -          In Agreement? :
   
       * If any request gets to the core handler, without a flag that this 
         r->filename was tested by dir/file_walk, we need to 500 at the very 
  
  
  
  1.67      +3 -0      httpd-2.0/include/util_filter.h
  
  Index: util_filter.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/util_filter.h,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- util_filter.h	27 Feb 2002 15:36:23 -0000	1.66
  +++ util_filter.h	3 Mar 2002 06:04:08 -0000	1.67
  @@ -263,6 +263,9 @@
       /** The next filter in the chain */
       ap_filter_t *next;
   
  +    /** The previous filter in the chain */
  +    ap_filter_t *prev;
  +
       /** The request_rec associated with the current filter.  If a sub-request
        *  adds filters, then the sub-request is the request associated with the
        *  filter.
  
  
  
  1.80      +72 -2     httpd-2.0/server/util_filter.c
  
  Index: util_filter.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/util_filter.c,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- util_filter.c	3 Mar 2002 02:15:52 -0000	1.79
  +++ util_filter.c	3 Mar 2002 06:04:08 -0000	1.80
  @@ -330,7 +330,31 @@
           if (node && node->frec) {
               apr_pool_t* p = r ? r->pool : c->pool;
               ap_filter_t *f = apr_palloc(p, sizeof(*f));
  -            ap_filter_t **outf = r ? (r_filters ? r_filters : p_filters) : c_filters;
  +            ap_filter_t **outf;
  +
  +            if (node->frec->ftype < AP_FTYPE_HTTP_HEADER) {
  +                if (r) {
  +                    outf = r_filters;
  +                }
  +                else {
  +                    ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, NULL,
  +                                 "a content filter was added without a request: %s", name);
  +                    return NULL;
  +                }
  +            }
  +            else if (node->frec->ftype < AP_FTYPE_CONNECTION) {
  +                if (r) {
  +                    outf = p_filters;
  +                }
  +                else {
  +                    ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, NULL,
  +                                 "a protocol filter was added without a request: %s", name);
  +                    return NULL;
  +                }
  +            }
  +            else {
  +                outf = c_filters;
  +            }
   
               f->frec = node->frec;
               f->ctx = ctx;
  @@ -339,13 +363,24 @@
   
               if (INSERT_BEFORE(f, *outf)) {
                   f->next = *outf;
  +                if ((*outf) && (*outf)->prev) {
  +                    f->prev = (*outf)->prev;
  +                    (*outf)->prev->next = f;
  +                    (*outf)->prev = f;
  +                }
  +                else {
  +                    f->prev = NULL;
  +                }
                   *outf = f;
               }
               else {
                   ap_filter_t *fscan = *outf;
                   while (!INSERT_BEFORE(f, fscan->next))
                       fscan = fscan->next;
  +
                   f->next = fscan->next;
  +                f->prev = fscan;
  +                fscan->next->prev = f;
                   fscan->next = f;
               }
   
  @@ -366,7 +401,31 @@
   {
       apr_pool_t* p = r ? r->pool : c->pool;
       ap_filter_t *f = apr_palloc(p, sizeof(*f));
  -    ap_filter_t **outf = r ? (r_filters ? r_filters : p_filters) : c_filters;
  +    ap_filter_t **outf;
  +
  +    if (frec->ftype < AP_FTYPE_HTTP_HEADER) {
  +        if (r) {
  +            outf = r_filters;
  +        }
  +        else {
  +            ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, NULL,
  +                      "a content filter was added without a request: %s", frec->name);
  +            return NULL;
  +        }
  +    }
  +    else if (frec->ftype < AP_FTYPE_CONNECTION) {
  +        if (r) {
  +            outf = p_filters;
  +        }
  +        else {
  +            ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, NULL,
  +                         "a protocol filter was added without a request: %s", frec->name);
  +            return NULL;
  +        }
  +    }
  +    else {
  +        outf = c_filters;
  +    }
   
       f->frec = frec;
       f->ctx = ctx;
  @@ -375,13 +434,24 @@
   
       if (INSERT_BEFORE(f, *outf)) {
           f->next = *outf;
  +        if ((*outf) && (*outf)->prev) {
  +            f->prev = (*outf)->prev;
  +            (*outf)->prev->next = f;
  +            (*outf)->prev = f;
  +        }
  +        else {
  +            f->prev = NULL;
  +        }
           *outf = f;
       }
       else {
           ap_filter_t *fscan = *outf;
           while (!INSERT_BEFORE(f, fscan->next))
               fscan = fscan->next;
  +
           f->next = fscan->next;
  +        f->prev = fscan;
  +        fscan->next->prev = f;
           fscan->next = f;
       }
   
  
  
  

Mime
View raw message