httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/standard mod_include.c
Date Fri, 22 Sep 2000 14:57:17 GMT
trawick     00/09/22 07:57:14

  Modified:    src/modules/standard mod_include.c
  Log:
  mod_include now tweaks the subrequest output filter chain so that
  only *subsequent* filters from the original request are inherited.
  Previously, *all* filters from the original request were inherited.
  
  Currently, any filter which runs a subrequest should do the same
  thing (though a cleaner interface may be appropriate.)
  
  With this change, subrequests are properly filtered much more often.
  
  Revision  Changes    Path
  1.64      +15 -6     apache-2.0/src/modules/standard/mod_include.c
  
  Index: mod_include.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_include.c,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- mod_include.c	2000/09/21 16:32:48	1.63
  +++ mod_include.c	2000/09/22 14:57:08	1.64
  @@ -622,7 +622,7 @@
   
   /* --------------------------- Action handlers ---------------------------- */
   
  -static int include_cgi(char *s, request_rec *r)
  +static int include_cgi(char *s, request_rec *r, ap_filter_t *next)
   {
       request_rec *rr = ap_sub_req_lookup_uri(s, r);
       int rr_status;
  @@ -651,6 +651,9 @@
   
       rr->content_type = CGI_MAGIC_TYPE;
   
  +    /* The subrequest should inherit the remaining filters from this request. */
  +    rr->output_filters = next;
  +
       /* Run it. */
   
       rr_status = ap_run_sub_req(rr);
  @@ -694,7 +697,8 @@
       return 1;
   }
   
  -static int handle_include(ap_bucket *in, request_rec *r, const char *error, int noexec)
  +static int handle_include(ap_bucket *in, request_rec *r, ap_filter_t *next,
  +                          const char *error, int noexec)
   {
       char tag[MAX_STRING_LEN];
       char parsed_string[MAX_STRING_LEN];
  @@ -779,8 +783,13 @@
   	    if (rr) 
   		ap_set_module_config(rr->request_config, &includes_module, r);
   
  -            if (!error_fmt && ap_run_sub_req(rr)) {
  -                error_fmt = "unable to include \"%s\" in parsed file %s";
  +            if (!error_fmt) {
  +                /* The subrequest should inherit the remaining filters from 
  +                 * this request. */
  +                rr->output_filters = next;
  +                if (ap_run_sub_req(rr)) {
  +                    error_fmt = "unable to include \"%s\" in parsed file %s";
  +                }
               }
               ap_chdir_file(r->filename);
               if (error_fmt) {
  @@ -982,7 +991,7 @@
           }
           else if (!strcmp(tag, "cgi")) {
               parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 0);
  -            if (include_cgi(parsed_string, r) == -1) {
  +            if (include_cgi(parsed_string, r, next) == -1) {
                   ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
                               "invalid CGI ref \"%s\" in %s", tag_val, file);
                   ap_rputs(error, r);
  @@ -2374,7 +2383,7 @@
                   ret = handle_set(tagbuck, r, error);
               }
               else if (!strcmp(directive, "include")) {
  -                ret = handle_include(tagbuck, r, error, noexec);
  +                ret = handle_include(tagbuck, r, f->next, error, noexec);
               }
               else if (!strcmp(directive, "echo")) {
                   ret = handle_echo(tagbuck, r, error);
  
  
  

Mime
View raw message