You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by bj...@locus.apache.org on 2000/04/20 17:20:38 UTC

cvs commit: apache-2.0/src/main buff.c http_config.c http_request.c rfc1413.c

bjh         00/04/20 08:20:37

  Modified:    src/main buff.c http_config.c http_request.c rfc1413.c
  Log:
  Use ap_canonical_error() where appropriate.
  
  Revision  Changes    Path
  1.38      +3 -3      apache-2.0/src/main/buff.c
  
  Index: buff.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/buff.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- buff.c	2000/04/20 14:36:00	1.37
  +++ buff.c	2000/04/20 15:20:31	1.38
  @@ -331,7 +331,7 @@
       else if (rv != APR_SUCCESS) {
   	fb->berrno = rv;
   	fb->saved_errno = rv;
  -	if (rv != APR_EAGAIN) {
  +	if (ap_canonical_error(rv) != APR_EAGAIN) {
   	    doerror(fb, B_RD);
   	}
       }
  @@ -569,7 +569,7 @@
       fb->bytes_sent += *bytes_written;
       if (rv != APR_SUCCESS) {
   	fb->saved_errno = rv;
  -	if (rv != APR_EAGAIN) {
  +	if (ap_canonical_error(rv) != APR_EAGAIN) {
   	    doerror(fb, B_WR);
   	}
       }
  @@ -750,7 +750,7 @@
       fb->bytes_sent += *bytes_written;
       if (rv != APR_SUCCESS) {
   	fb->saved_errno = rv;
  -	if (rv != APR_EAGAIN) {
  +	if (ap_canonical_error(rv) != APR_EAGAIN) {
   	    doerror(fb, B_WR);
   	}
       }
  
  
  
  1.39      +13 -10    apache-2.0/src/main/http_config.c
  
  Index: http_config.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_config.c,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- http_config.c	2000/04/16 23:28:52	1.38
  +++ http_config.c	2000/04/20 15:20:32	1.39
  @@ -1147,16 +1147,19 @@
               }
               *result = dc;
               break;
  -        }
  -        else if (status != APR_ENOENT && status != APR_ENOTDIR) {
  -            ap_log_rerror(APLOG_MARK, APLOG_CRIT, errno, r,
  -                          "%s pcfg_openfile: unable to check htaccess file, "
  -                          "ensure it is readable",
  -                          filename);
  -            ap_table_setn(r->notes, "error-notes",
  -                          "Server unable to read htaccess file, denying "
  -                          "access to be safe");
  -            return HTTP_FORBIDDEN;
  +        } else {
  +            ap_status_t cerr = ap_canonical_error(status);
  +
  +            if (cerr != APR_ENOENT && cerr != APR_ENOTDIR) {
  +                ap_log_rerror(APLOG_MARK, APLOG_CRIT, status, r,
  +                              "%s pcfg_openfile: unable to check htaccess file, "
  +                              "ensure it is readable",
  +                              filename);
  +                ap_table_setn(r->notes, "error-notes",
  +                              "Server unable to read htaccess file, denying "
  +                              "access to be safe");
  +                return HTTP_FORBIDDEN;
  +            }
           }
       }
   
  
  
  
  1.23      +4 -3      apache-2.0/src/main/http_request.c
  
  Index: http_request.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- http_request.c	2000/04/14 15:58:56	1.22
  +++ http_request.c	2000/04/20 15:20:32	1.23
  @@ -195,7 +195,7 @@
       char *path = r->filename;
       char *end = &path[strlen(path)];
       char *last_cp = NULL;
  -    int rv;
  +    int rv, rvc;
   #ifdef HAVE_DRIVE_LETTERS
       char bStripSlash=1;
   #endif
  @@ -286,9 +286,10 @@
   	 * even if they returned an error.
   	 */
   	r->finfo.protection = 0;
  +	rvc = ap_canonical_error(rv);
   
   #if defined(APR_ENOENT) && defined(APR_ENOTDIR)
  -        if (rv == APR_ENOENT || rv == APR_ENOTDIR) {
  +        if (rvc == APR_ENOENT || rvc == APR_ENOTDIR) {
               last_cp = cp;
   
               while (--cp > path && *cp != '/')
  @@ -299,7 +300,7 @@
           }
           else {
   #if defined(APR_EACCES)
  -            if (rv != APR_EACCES)
  +            if (rvc != APR_EACCES)
   #endif
                   ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                               "access to %s failed", r->uri);
  
  
  
  1.15      +2 -2      apache-2.0/src/main/rfc1413.c
  
  Index: rfc1413.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/rfc1413.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- rfc1413.c	2000/04/20 14:36:00	1.14
  +++ rfc1413.c	2000/04/20 15:20:33	1.15
  @@ -160,7 +160,7 @@
           ap_ssize_t j = strlen(buffer + i);
           ap_status_t status;
   	status  = ap_send(sock, buffer+i, &j);
  -	if (status != APR_SUCCESS && status != APR_EINTR) {
  +	if (status != APR_SUCCESS && ap_canonical_error(status) != APR_EINTR) {
   	    ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv,
   		         "write: rfc1413: error sending request");
   	    return -1;
  @@ -186,7 +186,7 @@
           ap_ssize_t j = sizeof(buffer) - 1 - i;
           ap_status_t status;
   	status = ap_recv(sock, buffer+i, &j);
  -	if (status != APR_SUCCESS && status != APR_EINTR) {
  +	if (status != APR_SUCCESS && ap_canonical_error(status) != APR_EINTR) {
   	    ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv,
   			"read: rfc1413: error reading response");
   	    return -1;