summaryrefslogtreecommitdiff
path: root/evrpc-internal.h
diff options
context:
space:
mode:
authorNiels Provos <provos@gmail.com>2007-12-27 23:17:24 +0000
committerNiels Provos <provos@gmail.com>2007-12-27 23:17:24 +0000
commit819d4a33d766d1d585f73abb9d7c77d4f862970f (patch)
tree0cf89dc67accef565b5b550c42d840c73bf837aa /evrpc-internal.h
parent76945273c674d51f1c2f12e646a5248a2f52ed0b (diff)
downloadlibevent-819d4a33d766d1d585f73abb9d7c77d4f862970f.tar.gz
allow hooks to pause RPC processing; this will allow hooks to do meaningful work before resuming the
RPC processing; this is not backwards compatible. svn:r617
Diffstat (limited to 'evrpc-internal.h')
-rw-r--r--evrpc-internal.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/evrpc-internal.h b/evrpc-internal.h
index c900f959..74183530 100644
--- a/evrpc-internal.h
+++ b/evrpc-internal.h
@@ -37,7 +37,8 @@ struct evrpc_hook {
TAILQ_ENTRY(evrpc_hook) (next);
/* returns -1; if the rpc should be aborted, is allowed to rewrite */
- int (*process)(struct evhttp_request *, struct evbuffer *, void *);
+ int (*process)(void *, struct evhttp_request *,
+ struct evbuffer *, void *);
void *process_arg;
};
@@ -48,14 +49,21 @@ TAILQ_HEAD(evrpc_hook_list, evrpc_hook);
* the hook adding functions; we alias both evrpc_pool and evrpc_base
* to this common structure.
*/
+
+struct evrpc_hook_ctx;
+TAILQ_HEAD(evrpc_pause_list, evrpc_hook_ctx);
+
struct _evrpc_hooks {
/* hooks for processing outbound and inbound rpcs */
struct evrpc_hook_list in_hooks;
struct evrpc_hook_list out_hooks;
+
+ struct evrpc_pause_list pause_requests;
};
#define input_hooks common.in_hooks
#define output_hooks common.out_hooks
+#define paused_requests common.pause_requests
struct evrpc_base {
struct _evrpc_hooks common;
@@ -80,8 +88,14 @@ struct evrpc_pool {
int timeout;
- TAILQ_HEAD(evrpc_requestq, evrpc_request_wrapper) requests;
+ TAILQ_HEAD(evrpc_requestq, evrpc_request_wrapper) (requests);
};
+struct evrpc_hook_ctx {
+ TAILQ_ENTRY(evrpc_hook_ctx) (next);
+
+ void *ctx;
+ void (*cb)(void *, enum EVRPC_HOOK_RESULT);
+};
#endif /* _EVRPC_INTERNAL_H_ */