fielding    97/03/31 21:41:46

  Modified:    src       CHANGES mod_negotiation.c
  Log:
  Petr's patch to merge r->notes, r->headers_out and r->err_headers_out
  didn't call overlay_tables properly.  This is the only bug fix.
  The other hunks are more destroy_sub_req()s that are similar to the other
  cleanups that Petr's patch performed.
  
  Submitted by: Dean Gaudet
  Reviewed by: Roy Fielding, Chuck Murcko
  
  Revision  Changes    Path
  1.218     +3 -0      apache/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache/src/CHANGES,v
  retrieving revision 1.217
  retrieving revision 1.218
  diff -C3 -r1.217 -r1.218
  *** CHANGES   1997/04/01 05:04:24     1.217
  --- CHANGES   1997/04/01 05:41:43     1.218
  ***************
  *** 77,82 ****
  --- 77,85 ----
         no variants found; Add handling of '*' wildcard in Accept-Charset.
         [Petr Lampa and Paul Sutton]
    
  +   *) Fixed overlaying of request/sub-request notes and headers in
  +      mod_negotiation.  [Dean Gaudet]
  + 
      *) If two variants' charset quality are equal and one is the default
         charset (iso-8859-1), then prefer the variant that was specifically
         listed in Accept-Charset instead of the default.  [Petr Lampa]
  
  
  
  1.38      +17 -6     apache/src/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/mod_negotiation.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -C3 -r1.37 -r1.38
  *** mod_negotiation.c 1997/03/24 22:07:06     1.37
  --- mod_negotiation.c 1997/04/01 05:41:44     1.38
  ***************
  *** 764,770 ****
        if (sub_req->handler && !sub_req->content_type)
          sub_req->content_type = CGI_MAGIC_TYPE;
    
  !     if (sub_req->status != HTTP_OK || !sub_req->content_type) continue;
        
        /* If it's a map file, we use that instead of the map
         * we're building...
  --- 764,773 ----
        if (sub_req->handler && !sub_req->content_type)
          sub_req->content_type = CGI_MAGIC_TYPE;
    
  !     if (sub_req->status != HTTP_OK || !sub_req->content_type) {
  !         destroy_sub_req(sub_req);
  !         continue;
  !     }
        
        /* If it's a map file, we use that instead of the map
         * we're building...
  ***************
  *** 1806,1814 ****
        char *sub_vary;
    
        if (!variant->sub_req) {
            sub_req = sub_req_lookup_file(variant->file_name, r);
  !         if (sub_req->status != HTTP_OK && sub_req->status != 
HTTP_MULTIPLE_CHOICES)
  !             return sub_req->status;
            variant->sub_req = sub_req;
        }
        else 
  --- 1809,1822 ----
        char *sub_vary;
    
        if (!variant->sub_req) {
  +         int status;
  + 
            sub_req = sub_req_lookup_file(variant->file_name, r);
  !         status = sub_req->status;
  !         if (status != HTTP_OK && status != HTTP_MULTIPLE_CHOICES) {
  !             destroy_sub_req(sub_req);
  !             return status;
  !         }
            variant->sub_req = sub_req;
        }
        else 
  ***************
  *** 1970,1975 ****
  --- 1978,1984 ----
            sub_req = sub_req_lookup_file (best->file_name, r);
            if (sub_req->status != HTTP_OK) {
               res = sub_req->status;
  +            destroy_sub_req(sub_req);
               goto return_from_multi;
            }
        }
  ***************
  *** 1997,2005 ****
        r->content_language = sub_req->content_language;
        r->finfo = sub_req->finfo;
        /* copy output headers from subrequest, but leave negotiation headers */
  !     overlay_tables(r->pool, sub_req->notes, r->notes);
  !     overlay_tables(r->pool, sub_req->headers_out, r->headers_out);
  !     overlay_tables(r->pool, sub_req->err_headers_out, r->err_headers_out);
        avail_recs = (var_rec *)neg->avail_vars->elts;
        for (j = 0; j < neg->avail_vars->nelts; ++j) {
            var_rec *variant = &avail_recs[j];
  --- 2006,2016 ----
        r->content_language = sub_req->content_language;
        r->finfo = sub_req->finfo;
        /* copy output headers from subrequest, but leave negotiation headers */
  !     r->notes = overlay_tables(r->pool, sub_req->notes, r->notes);
  !     r->headers_out = overlay_tables(r->pool, sub_req->headers_out,
  !                                              r->headers_out);
  !     r->err_headers_out = overlay_tables(r->pool, sub_req->err_headers_out,
  !                                                  r->err_headers_out);
        avail_recs = (var_rec *)neg->avail_vars->elts;
        for (j = 0; j < neg->avail_vars->nelts; ++j) {
            var_rec *variant = &avail_recs[j];
  
  
  

Reply via email to