You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1997/06/27 00:10:21 UTC

[PATCH] 'DONE' handler response

I was told this was a feature and couldn't go into 1.2, so here it is
again. It adds a new handler response "DONE = -2" and handlers which
return it can inform Apache that the request has been handled and that
it can finish off the request quickly, as it does with errors, but without
groaning about an error (the request is logged).

About 50% of all requests to my servers go through this and I've been
using it for months. It seems to work :-)


Index: httpd.h
===================================================================
RCS file: /imdb/cvs/apache/src/httpd.h,v
retrieving revision 1.26
diff -u -r1.26 httpd.h
--- httpd.h	1997/06/16 15:19:13	1.26
+++ httpd.h	1997/06/16 15:20:05
@@ -269,6 +269,9 @@
 #define SERVER_SUPPORT "http://www.apache.org/"
 
 #define DECLINED -1		/* Module declines to handle */
+#define DONE -2                 /* Module has served the response completely 
+                                 *  - it's safe to die() with no more output
+                                 */
 #define OK 0			/* Module has handled this stage. */
 
 /* ----------------------- HTTP Status Codes  ------------------------- */
Index: http_request.c
===================================================================
RCS file: /imdb/cvs/apache/src/http_request.c,v
retrieving revision 1.17
diff -u -r1.17 http_request.c
--- http_request.c	1997/06/16 15:19:12	1.17
+++ http_request.c	1997/06/16 15:20:04
@@ -745,6 +745,8 @@
     int error_index = index_of_response (type);
     char *custom_response = response_code_string(r, error_index);
     int recursive_error = 0;
+
+    if (type == DONE) return;
     
     /* The following takes care of Apache redirects to custom response URLs
      * Note that if we are already dealing with the response to some other