summaryrefslogtreecommitdiff
path: root/evrpc-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'evrpc-internal.h')
-rw-r--r--evrpc-internal.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/evrpc-internal.h b/evrpc-internal.h
index 8b8dd691..c900f959 100644
--- a/evrpc-internal.h
+++ b/evrpc-internal.h
@@ -41,16 +41,30 @@ struct evrpc_hook {
void *process_arg;
};
+TAILQ_HEAD(evrpc_hook_list, evrpc_hook);
+
+/*
+ * this is shared between the base and the pool, so that we can reuse
+ * the hook adding functions; we alias both evrpc_pool and evrpc_base
+ * to this common structure.
+ */
+struct _evrpc_hooks {
+ /* hooks for processing outbound and inbound rpcs */
+ struct evrpc_hook_list in_hooks;
+ struct evrpc_hook_list out_hooks;
+};
+
+#define input_hooks common.in_hooks
+#define output_hooks common.out_hooks
+
struct evrpc_base {
+ struct _evrpc_hooks common;
+
/* 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;
@@ -58,6 +72,10 @@ void evrpc_reqstate_free(struct evrpc_req_generic* rpc_state);
/* A pool for holding evhttp_connection objects */
struct evrpc_pool {
+ struct _evrpc_hooks common;
+
+ struct event_base *base;
+
struct evconq connections;
int timeout;