From 65236aa8578aeb17c088b41818da17311672aed1 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Fri, 2 Nov 2007 06:34:04 +0000 Subject: simple hooks for processing incoming and outgoing rpcs svn:r466 --- evrpc-internal.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'evrpc-internal.h') diff --git a/evrpc-internal.h b/evrpc-internal.h index 656533b6..8b8dd691 100644 --- a/evrpc-internal.h +++ b/evrpc-internal.h @@ -33,12 +33,24 @@ struct evrpc; #define EVRPC_URI_PREFIX "/.rpc." +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 *); + void *process_arg; +}; + struct evrpc_base { /* the HTTP server under which we register our RPC calls */ struct evhttp* http_server; /* a list of all RPCs registered with us */ TAILQ_HEAD(evrpc_list, evrpc) registered_rpcs; + + /* hooks for processing outbound and inbound rpcs */ + TAILQ_HEAD(evrpc_hook_list, evrpc_hook) input_hooks; + struct evrpc_hook_list output_hooks; }; struct evrpc_req_generic; -- cgit v1.2.1