httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Thu, 03 Oct 2002 00:16:48 GMT
gstein      2002/10/02 17:16:48

  Modified:    include  http_core.h
               server   core.c
  Log:
  Add logic to the default_handler to enable script delivery to script
  processors located in the output filter stack. This is on by default,
  but will change "soon" to off -- the processors will then need to
  enable it when they are installed into the filter chain.
  
  Revision  Changes    Path
  1.68      +10 -0     httpd-2.0/include/http_core.h
  
  Index: http_core.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/http_core.h,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- http_core.h	11 May 2002 23:24:29 -0000	1.67
  +++ http_core.h	3 Oct 2002 00:16:47 -0000	1.68
  @@ -342,6 +342,16 @@
        * to add elements)
        */
       void **notes;
  +
  +    /* There is a script processor installed on the output filter chain,
  +     * so it needs the default_handler to deliver a (script) file into
  +     * the chain so it can process it. Normally, default_handler only
  +     * serves files on a GET request (assuming the file is actual content),
  +     * since other methods are not content-retrieval. This flag overrides
  +     * that behavior, stating that the "content" is actually a script and
  +     * won't actually be delivered as the response for the non-GET method.
  +     */
  +    int deliver_script;
   } core_request_config;
   
   /* Standard entries that are guaranteed to be accessible via
  
  
  
  1.210     +25 -0     httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.209
  retrieving revision 1.210
  diff -u -r1.209 -r1.210
  --- core.c	2 Oct 2002 21:35:57 -0000	1.209
  +++ core.c	3 Oct 2002 00:16:47 -0000	1.210
  @@ -3262,6 +3262,27 @@
               return HTTP_NOT_FOUND;
           }
   
  +        /* We understood the (non-GET) method, but it might not be legal for
  +           this particular resource. Check to see if the 'deliver_script'
  +           flag is set. If so, then we go ahead and deliver the file since
  +           it isn't really content (only GET normally returns content).
  +
  +           Note: based on logic further above, the only possible non-GET
  +           method at this point is POST. In the future, we should enable
  +           script delivery for all methods.  */
  +        if (r->method_number != M_GET) {
  +            core_request_config *req_cfg;
  +
  +            req_cfg = ap_get_module_config(r->request_config, &core_module);
  +            if (!req_cfg->deliver_script) {
  +                /* The flag hasn't been set for this request. Punt. */
  +                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
  +                              "This resource does not accept the %s method.",
  +                              r->method);
  +                return HTTP_METHOD_NOT_ALLOWED;
  +            }
  +        }
  +
           if ((status = apr_file_open(&fd, r->filename, APR_READ | APR_BINARY, 0,
                                       r->pool)) != APR_SUCCESS) {
               ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r,
  @@ -4003,6 +4024,10 @@
       req_cfg = apr_pcalloc(r->pool, sizeof(core_request_config) +
                             sizeof(void *) * num_request_notes);
       req_cfg->notes = (void **)((char *)req_cfg + sizeof(core_request_config));
  +
  +    /* ### temporarily enable script delivery as the default */
  +    req_cfg->deliver_script = 1;
  +
       if (r->main) {
           core_request_config *main_req_cfg = (core_request_config *)
               ap_get_module_config(r->main->request_config, &core_module);
  
  
  

Mime
View raw message