Hi Adding this function to the api would allow errors to be served outside of _stage_* callbacks (requires return of MK_PLUGIN_RET_END or MK_PLUGIN_RET_CLOSE_CONX currently). Together with header_send and http_request_end this will allow serving all content from _event_* callbacks.
Sorry about this very late patch, I know that you're preparing to release v1.1. I've been looking for a way to generate errors late in a request and have found non that doesn't involve generating my own error messages or some advanced logic in _stage_30. -- Sonny Karlsson
>From 2d334acc81247077ca3971fd23254399e3854bc7 Mon Sep 17 00:00:00 2001 From: Sonny Karlsson <[email protected]> Date: Wed, 1 Aug 2012 11:54:26 +0200 Subject: [PATCH] plugin_api: Add http_request_error. Allow serving errors outside of _stage_* callbacks. Signed-off-by: Sonny Karlsson <[email protected]> --- src/include/mk_plugin.h | 1 + src/mk_plugin.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/include/mk_plugin.h b/src/include/mk_plugin.h index 915df4f..2eb4790 100644 --- a/src/include/mk_plugin.h +++ b/src/include/mk_plugin.h @@ -186,6 +186,7 @@ struct plugin_api /* HTTP request function */ int (*http_request_end) (int); + int (*http_request_error) (int, struct client_session *, struct session_request *); /* memory functions */ void *(*mem_alloc) (const size_t size); diff --git a/src/mk_plugin.c b/src/mk_plugin.c index c857cbb..464e57c 100644 --- a/src/mk_plugin.c +++ b/src/mk_plugin.c @@ -325,6 +325,7 @@ void mk_plugin_init() /* HTTP callbacks */ api->http_request_end = mk_plugin_http_request_end; + api->http_request_error = mk_request_error; /* Memory callbacks */ api->pointer_set = mk_pointer_set; -- 1.7.10.4
_______________________________________________ Monkey mailing list [email protected] http://lists.monkey-project.com/listinfo/monkey
