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 core.c
Date Thu, 13 Dec 2001 02:35:31 GMT
wrowe       01/12/12 18:35:31

  Modified:    server   core.c
  Log:
    Kill some redundancy (why test PUT when we disallow all but GET/POST?)
    and add some thoughts.
  
  Revision  Changes    Path
  1.116     +15 -16    httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.115
  retrieving revision 1.116
  diff -u -r1.115 -r1.116
  --- core.c	2001/12/13 00:46:40	1.115
  +++ core.c	2001/12/13 02:35:31	1.116
  @@ -2705,10 +2705,14 @@
   
       ap_allow_standard_methods(r, MERGE_ALLOW, M_GET, M_OPTIONS, M_POST, -1);
   
  +    /* If filters intend to consume the request body, they must
  +     * register an InputFilter to slurp the contents of the POST
  +     * data from the POST input stream.  It no longer exists when
  +     * the output filters are invoked by the default handler.
  +     */
       if ((errstatus = ap_discard_request_body(r)) != OK) {
           return errstatus;
       }
  -    
       if (r->method_number == M_INVALID) {
   	ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
   		    "Invalid method in request %s", r->the_request);
  @@ -2717,25 +2721,20 @@
       if (r->method_number == M_OPTIONS) {
           return ap_send_http_options(r);
       }
  -    if (r->method_number == M_PUT) {
  +    if (r->method_number != M_GET && r->method_number != M_POST) {
           return HTTP_METHOD_NOT_ALLOWED;
       }
       if (r->finfo.filetype == 0) {
  -	ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r,
  -		      "File does not exist: %s", r->filename);
  -	return HTTP_NOT_FOUND;
  -    }
  -    if (r->path_info && *r->path_info) {
  -	ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r,
  -		      "File does not exist: %s",
  -		      apr_pstrcat(r->pool, r->filename, r->path_info, NULL));
  -	return HTTP_NOT_FOUND;
  -    }
  -    
  -    if (r->method_number != M_GET && r->method_number != M_POST) {
  -        return HTTP_METHOD_NOT_ALLOWED;
  +        ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r,
  +                      "File does not exist: %s", r->filename);
  +        return HTTP_NOT_FOUND;
  +    }
  +    if (!r->used_path_info && r->path_info && *r->path_info) {
  +        ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r,
  +                      "File does not exist: %s",
  +                      apr_pstrcat(r->pool, r->filename, r->path_info, NULL));
  +        return HTTP_NOT_FOUND;
       }
  -
       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,
   		     "file permissions deny server access: %s", r->filename);
  
  
  

Mime
View raw message