diff options
author | Ryan Bloom <rbb@apache.org> | 2001-01-27 08:13:39 +0100 |
---|---|---|
committer | Ryan Bloom <rbb@apache.org> | 2001-01-27 08:13:39 +0100 |
commit | fd0256ed99c6e70c5d3cf93dfd7bbb537435eeed (patch) | |
tree | cd192d0ad07f4b5cce1e356685df19c0371327bd /include | |
parent | Much better for win32 checkouts (diff) | |
download | apache2-fd0256ed99c6e70c5d3cf93dfd7bbb537435eeed.tar.xz apache2-fd0256ed99c6e70c5d3cf93dfd7bbb537435eeed.zip |
filters can now report an HTTP error to the server. This is done
by sending a brigade where the first bucket is an error_bucket.
This bucket is a simple bucket that stores an HTTP error and
a string. Currently the string is not used, but it may be needed
to output an error log. The http_header_filter will find this
bucket, and output the error text, and then return
AP_FILTER_ERROR, which informs the server that the error web page
has already been sent.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87863 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r-- | include/http_protocol.h | 42 | ||||
-rw-r--r-- | include/util_filter.h | 1 |
2 files changed, 43 insertions, 0 deletions
diff --git a/include/http_protocol.h b/include/http_protocol.h index 578e03d170..09985a185b 100644 --- a/include/http_protocol.h +++ b/include/http_protocol.h @@ -59,9 +59,11 @@ #ifndef APACHE_HTTP_PROTOCOL_H #define APACHE_HTTP_PROTOCOL_H +#include "httpd.h" #include "apr_hooks.h" #include "apr_portable.h" #include "apr_mmap.h" +#include "apr_buckets.h" #ifdef __cplusplus extern "C" { @@ -550,6 +552,46 @@ AP_DECLARE_HOOK(const char *,http_method,(const request_rec *)) */ AP_DECLARE_HOOK(apr_port_t,default_port,(const request_rec *)) +typedef struct ap_bucket_error ap_bucket_error; +/** + * A bucket referring to an HTTP error + * This bucket can be passed down the filter stack to indicate that an + * HTTP error occurred while running a filter. In order for this bucket + * to be used successfully, it MUST be sent as the first bucket in the + * first brigade to be sent from a given filter. + */ +struct ap_bucket_error { + /** The start of the data actually allocated. This should never be + * modified, it is only used to free the bucket. + */ + char *start; +}; + +extern const apr_bucket_type_t ap_bucket_type_error; + +/** + * Make the bucket passed in an error bucket + * @param b The bucket to make into an error bucket + * @param error The HTTP error code to put in the bucket. + * @param buf An optional error string to put in the bucket. + * @param p A pool to allocate out of. + * @return The new bucket, or NULL if allocation failed + * @deffunc apr_bucket *ap_bucket_make_error(apr_bucket *b, int error, const char *buf, apr_pool_t *p) + */ +AP_DECLARE(apr_bucket *) ap_bucket_make_error(apr_bucket *b, int error, + const char *buf, apr_pool_t *p); + +/** + * Create a bucket referring to an HTTP error. + * @param error The HTTP error code to put in the bucket. + * @param buf An optional error string to put in the bucket. + * @param p A pool to allocate out of. + * @return The new bucket, or NULL if allocation failed + * @deffunc apr_bucket *ap_bucket_create_error(int error, const char *buf, apr_pool_t *p) + */ +AP_DECLARE(apr_bucket *) ap_bucket_create_error(int error, + const char *buf, apr_pool_t *p); + #ifdef __cplusplus } #endif diff --git a/include/util_filter.h b/include/util_filter.h index e01b04a264..e340bd70c9 100644 --- a/include/util_filter.h +++ b/include/util_filter.h @@ -73,6 +73,7 @@ extern "C" { #define AP_NOBODY_WROTE -1 #define AP_NOBODY_READ -2 +#define AP_FILTER_ERROR -3 /* ap_input_mode_t - input filtering modes * |