httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/server request.c
Date Thu, 13 Dec 2001 02:26:18 GMT
wrowe       01/12/12 18:26:18

  Modified:    server   request.c
  Log:
    . unwind MORE redundant code [wasn't I just here six months ago???]
  
    . fix a redundant return [how no compilers caught a code-not-reachable
      is beyond me :]
  
  Revision  Changes    Path
  1.85      +15 -31    httpd-2.0/server/request.c
  
  Index: request.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/request.c,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- request.c	2001/12/09 18:08:08	1.84
  +++ request.c	2001/12/13 02:26:18	1.85
  @@ -164,7 +164,6 @@
   
           if ((access_status = ap_run_translate_name(r))) {
               return decl_die(access_status, "translate", r);
  -            return access_status;
           }
       }
   
  @@ -1363,20 +1362,16 @@
    * structure...
    */
   
  -static request_rec *make_sub_request(const request_rec *r)
  +static request_rec *make_sub_request(const request_rec *r, 
  +                                     ap_filter_t *next_filter)
   {
       apr_pool_t *rrp;
  -    request_rec *rr;
  +    request_rec *rnew;
       
       apr_pool_create(&rrp, r->pool);
  -    rr = apr_pcalloc(rrp, sizeof(request_rec));
  -    rr->pool = rrp;
  -    return rr;
  -}
  +    rnew = apr_pcalloc(rrp, sizeof(request_rec));
  +    rnew->pool = rrp;
   
  -static void fill_in_sub_req_vars(request_rec *rnew, const request_rec *r,
  -                                 ap_filter_t *next_filter)
  -{
       rnew->hostname       = r->hostname;
       rnew->request_time   = r->request_time;
       rnew->connection     = r->connection;
  @@ -1410,6 +1405,13 @@
       /* no input filters for a subrequest */
   
       ap_set_sub_req_protocol(rnew, r);
  +
  +    /* We have to run this after we fill in sub req vars, 
  +     * or the r->main pointer won't be setup
  +     */
  +    ap_run_create_request(rnew);
  +
  +    return rnew;
   }
   
   AP_CORE_DECLARE_NONSTD(apr_status_t) ap_sub_req_output_filter(ap_filter_t *f,
  @@ -1462,14 +1464,8 @@
       int res;
       char *udir;
   
  -    rnew = make_sub_request(r);
  -    fill_in_sub_req_vars(rnew, r, next_filter);
  +    rnew = make_sub_request(r, next_filter);
   
  -    /* We have to run this after fill_in_sub_req_vars, or the r->main
  -     * pointer won't be setup
  -     */
  -    ap_run_create_request(rnew);
  -
       /* would be nicer to pass "method" to ap_set_sub_req_protocol */
       rnew->method = method;
       rnew->method_number = ap_method_number_of(method);
  @@ -1506,14 +1502,8 @@
       char *fdir;
       char *udir;
   
  -    rnew = make_sub_request(r);
  -    fill_in_sub_req_vars(rnew, r, next_filter);
  +    rnew = make_sub_request(r, next_filter);
   
  -    /* We have to run this after fill_in_sub_req_vars, or the r->main
  -     * pointer won't be setup
  -     */
  -    ap_run_create_request(rnew);
  -
       /* Special case: we are looking at a relative lookup in the same directory. 
        * This is 100% safe, since dirent->name just came from the filesystem.
        */
  @@ -1600,14 +1590,8 @@
       int res;
       char *fdir;
       apr_size_t fdirlen;
  -
  -    rnew = make_sub_request(r);
  -    fill_in_sub_req_vars(rnew, r, next_filter);
   
  -    /* We have to run this after fill_in_sub_req_vars, or the r->main
  -     * pointer won't be setup
  -     */
  -    ap_run_create_request(rnew);
  +    rnew = make_sub_request(r, next_filter);
   
       fdir = ap_make_dirstr_parent(rnew->pool, r->filename);
       fdirlen = strlen(fdir);
  
  
  

Mime
View raw message