You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2002/06/22 18:32:45 UTC

cvs commit: httpd-2.0/modules/generators mod_cgi.c mod_cgid.c

wrowe       2002/06/22 09:32:45

  Modified:    include  http_request.h
               modules/generators mod_cgi.c mod_cgid.c
  Log:
    Note the changed meaning of the NULL next_filter argument to the
    ap_sub_req_lookup() family, and fix a few oddball cases (those are,
    PATH_TRANSLATED reference issues.)
  
  Revision  Changes    Path
  1.40      +3 -3      httpd-2.0/include/http_request.h
  
  Index: http_request.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/http_request.h,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- http_request.h	13 Mar 2002 20:47:42 -0000	1.39
  +++ http_request.h	22 Jun 2002 16:32:45 -0000	1.40
  @@ -108,7 +108,7 @@
    * @param new_file The URI to lookup
    * @param r The current request
    * @param next_filter The first filter the sub_request should use.  If this is
  - *                    NULL, it defaults to the first filter for the main request
  + *                    NULL this subrequest cannot be served [lookup only]
    * @return The new request record
    * @deffunc request_rec * ap_sub_req_lookup_uri(const char *new_file, const request_rec *r)
    */
  @@ -122,7 +122,7 @@
    * @param new_file The URI to lookup
    * @param r The current request
    * @param next_filter The first filter the sub_request should use.  If this is
  - *                    NULL, it defaults to the first filter for the main request
  + *                    NULL this subrequest cannot be served [lookup only]
    * @return The new request record
    * @deffunc request_rec * ap_sub_req_lookup_file(const char *new_file, const request_rec *r)
    */
  @@ -140,7 +140,7 @@
    *      AP_SUBREQ_MERGE_ARGS  merge r->args and r->path_info
    * </PRE>
    * @param next_filter The first filter the sub_request should use.  If this is
  - *                    NULL, it defaults to the first filter for the main request
  + *                    NULL this subrequest cannot be served [lookup only]
    * @return The new request record
    * @deffunc request_rec * ap_sub_req_lookup_dirent(apr_finfo_t *finfo, int subtype, const request_rec *r)
    * @tip The apr_dir_read flags value APR_FINFO_MIN|APR_FINFO_NAME flag is the 
  
  
  
  1.144     +1 -1      httpd-2.0/modules/generators/mod_cgi.c
  
  Index: mod_cgi.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgi.c,v
  retrieving revision 1.143
  retrieving revision 1.144
  diff -u -r1.143 -r1.144
  --- mod_cgi.c	13 Jun 2002 06:36:40 -0000	1.143
  +++ mod_cgi.c	22 Jun 2002 16:32:45 -0000	1.144
  @@ -361,7 +361,7 @@
                                                              r->path_info));
   
           pa_req = ap_sub_req_lookup_uri(ap_escape_uri(r->pool, r->path_info),
  -                                       r, next);
  +                                       r, NULL);
           if (pa_req->filename) {
               apr_table_setn(e, "PATH_TRANSLATED",
                              apr_pstrcat(r->pool, pa_req->filename,
  
  
  
  1.138     +1 -1      httpd-2.0/modules/generators/mod_cgid.c
  
  Index: mod_cgid.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgid.c,v
  retrieving revision 1.137
  retrieving revision 1.138
  diff -u -r1.137 -r1.138
  --- mod_cgid.c	13 Jun 2002 19:41:17 -0000	1.137
  +++ mod_cgid.c	22 Jun 2002 16:32:45 -0000	1.138
  @@ -1371,7 +1371,7 @@
   
           apr_table_setn(e, "PATH_INFO", ap_escape_shell_cmd(r->pool, r->path_info));
   
  -        pa_req = ap_sub_req_lookup_uri(ap_escape_uri(r->pool, r->path_info), r, next);
  +        pa_req = ap_sub_req_lookup_uri(ap_escape_uri(r->pool, r->path_info), r, NULL);
           if (pa_req->filename) {
               apr_table_setn(e, "PATH_TRANSLATED",
                              apr_pstrcat(r->pool, pa_req->filename, pa_req->path_info, NULL));
  
  
  

RE: cvs commit: httpd-2.0/modules/generators mod_cgi.c mod_cgid.c

Posted by Ryan Bloom <rb...@covalent.net>.
> From: William A. Rowe, Jr. [mailto:wrowe@rowe-clan.net]
> Sent: Saturday, June 22, 2002 9:45 AM
> To: dev@httpd.apache.org
> Subject: Re: cvs commit: httpd-2.0/modules/generators mod_cgi.c
mod_cgid.c
> 
> Looking for both faults (passing the next filter when we are doing
> lookups,
> and passing NULL when we are going to serve the content) ... it really
> seems that;
> 
> D:\clean\httpd-2.0\modules\mappers\mod_negotiation.c(2550):
>          sub_req = ap_sub_req_lookup_file(variant->file_name, r,
NULL);
> 
> SHOULD be setting the next filter.  Anyone want to dig on this?

I am missing something.  The third argument has nothing to do with
whether the request will be served.  It has to do with how the filter
stack is initialized in the sub-request.  If the argument is NULL, the
sub-requests filters are set to the protocol filters of the original
request.  If the argument isn't NULL, then the sub-request's filters are
initialized to the filter passed in.  In either case, the data can
either be sent or not.

Please revert the doc portions of your last change, they are incorrect.
The code is safe to leave, because the requests aren't actually served.
However, mod_negotiation is 100% correct, and should NOT be changed.

Ryan

> 
> Bill
> 
> >wrowe       2002/06/22 09:32:45
> >
> >   Modified:    include  http_request.h
> >                modules/generators mod_cgi.c mod_cgid.c
> >   Log:
> >     Note the changed meaning of the NULL next_filter argument to the
> >     ap_sub_req_lookup() family, and fix a few oddball cases (those
are,
> >     PATH_TRANSLATED reference issues.)
> 



Re: cvs commit: httpd-2.0/modules/generators mod_cgi.c mod_cgid.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Looking for both faults (passing the next filter when we are doing lookups,
and passing NULL when we are going to serve the content) ... it really
seems that;

D:\clean\httpd-2.0\modules\mappers\mod_negotiation.c(2550):
         sub_req = ap_sub_req_lookup_file(variant->file_name, r, NULL);

SHOULD be setting the next filter.  Anyone want to dig on this?

Bill

>wrowe       2002/06/22 09:32:45
>
>   Modified:    include  http_request.h
>                modules/generators mod_cgi.c mod_cgid.c
>   Log:
>     Note the changed meaning of the NULL next_filter argument to the
>     ap_sub_req_lookup() family, and fix a few oddball cases (those are,
>     PATH_TRANSLATED reference issues.)