summaryrefslogtreecommitdiff
path: root/evrpc-internal.h
diff options
context:
space:
mode:
authorNiels Provos <provos@gmail.com>2007-11-02 06:34:04 +0000
committerNiels Provos <provos@gmail.com>2007-11-02 06:34:04 +0000
commit65236aa8578aeb17c088b41818da17311672aed1 (patch)
tree14ace7e01f2ea1e59a9d7c11a00a49e6c3e7f819 /evrpc-internal.h
parent18ac92486fc7b4f2ac7092ce56dc89ebad41c729 (diff)
downloadlibevent-65236aa8578aeb17c088b41818da17311672aed1.tar.gz
simple hooks for processing incoming and outgoing rpcs
svn:r466
Diffstat (limited to 'evrpc-internal.h')
-rw-r--r--evrpc-internal.h12
1 files changed, 12 insertions, 0 deletions
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;