httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <r...@imdb.com>
Subject bug/feature request
Date Tue, 18 Feb 1997 14:54:13 GMT

I have a need to allow a handler (HeaderParser in this case) to
return a response code that indicates "All done - nothing else to do".

It'd be wonderfully useful if "die" could do *nothing* based on a specific
response code, say DONE=-2

At the moment I've got a handler that sends a full response to the
client and then returns to Apache to call "die" which then insists on
tagging on another set of headers and an explanation of what went *wrong*.
For me, that's a bug that I can't work around.

Attached is a patch to achieve my goal:

_______________________________________________________________________
Rob Hartill.       Internet Movie Database Ltd.    http://www.imdb.com/
CGI ? how quaint.


Index: http_request.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_request.c,v
retrieving revision 1.10
diff -u -r1.10 http_request.c
--- http_request.c      1997/02/10 16:58:54     1.10
+++ http_request.c      1997/02/18 14:40:52
@@ -748,7 +748,9 @@
     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
      * error condition, we just report on the original error, and give up on
Index: httpd.h
===================================================================
RCS file: /export/home/cvs/apache/src/httpd.h,v
retrieving revision 1.12
diff -u -r1.12 httpd.h
--- httpd.h     1997/02/16 23:41:43     1.12
+++ httpd.h     1997/02/18 14:49:57
@@ -259,6 +259,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  ------------------------- */







Mime
View raw message