httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Bley <j...@acpub.duke.edu>
Subject [PATCH] Error logging in http_core.c: extra info, fseek()
Date Sat, 06 Mar 1999 16:51:06 GMT
An ap_log_error that could report its server didn't, and fseek failing is 
probably a bad thing.

diff -Burp apache-1.3/src/main/http_core.c apache-1.3-patched/src/main/http_core.c
--- apache-1.3/src/main/http_core.c	Wed Feb 24 09:12:26 1999
+++ apache-1.3-patched/src/main/http_core.c	Sat Mar  6 11:42:15 1999
@@ -1070,7 +1070,7 @@ static const char *set_error_document(cm
 
     if (error_number == 401 &&
 	line[0] != '/' && line[0] != '"') { /* Ignore it... */
-	ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, NULL,
+	ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, cmd->server,
 		     "cannot use a full URL in a 401 ErrorDocument "
 		     "directive --- ignoring!");
     }
@@ -3066,7 +3066,10 @@ static int default_handler(request_rec *
 	    else {
 		long offset, length;
 		while (ap_each_byterange(r, &offset, &length)) {
-		    fseek(f, offset, SEEK_SET);
+		    if (fseek(f, offset, SEEK_SET))
+			ap_log_error(APLOG_MARK, APLOG_ERR, r->server,
+			    "Couldn't fseek(%d, %d): possible I/O failure",
+			    f, offset);
 		    ap_send_fd_length(f, r, length);
 		}
 	    }


-- 
John Bley - jbb6@acpub.duke.edu
Duke '99 - English/Computer Science
  Since English is a mess, it maps well onto the problem space,
  which is also a mess, which we call reality.     - Larry Wall


Mime
View raw message