Ryan Morgan found a bug earlier today that he was finding 104 errors in
his access_log.  We then looked through the code, and tracked the
problem down.  The problem can be tracked to the return code from
filters.  Essentially, filters were supposed to return HTTP status
codes, so that the server could do the right thing, and any log messages
should be logged from within the server.  Unfortunately, I don't believe
most of our filters do that.  This leads to us logging errno values
instead of HTTP status codes.

This patch fixes the core_output_filter.  There are two error cases, I
am 100% convinced that the first one should be a 500 error (if a bucket
is unreadable), but the second has me stumped.  If the user aborts the
connection we shouldn't log 200, but I don't know what is correct.  Ryan
and I decided to use 206 for now.  Can I get some opinions on the
correct value?

Ryan

? server/gen_test_char.vcproj
Index: server/core.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/core.c,v
retrieving revision 1.166
diff -u -d -b -w -u -r1.166 core.c
--- server/core.c       20 Mar 2002 22:19:10 -0000      1.166
+++ server/core.c       22 Mar 2002 20:25:56 -0000
@@ -3744,7 +3744,7 @@
                     if (rv != APR_SUCCESS) {
                         ap_log_error(APLOG_MARK, APLOG_ERR, rv,
c->base_server,
                                      "core_output_filter: Error reading
from bucket.");
-                        return rv;
+                        return HTTP_INTERNAL_SERVER_ERROR;
                     }
 
                     apr_brigade_write(ctx->b, NULL, NULL, str, n);
@@ -3829,7 +3829,7 @@
                 c->aborted = 1;
             }
 
-            return rv;
+            return HTTP_PARTIAL_CONTENT;
         }
 
         b = more;


----------------------------------------------
Ryan Bloom                  [EMAIL PROTECTED]
645 Howard St.              [EMAIL PROTECTED]
San Francisco, CA 


Reply via email to