mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-09 12:28:19 -04:00
Expose the request and reply members of rpc_req_generic()
This code adds two accessor functions to evprc, and helps integrate evrpc with Google protocol buffers. (Code by Shuo Chen; commit message by nickm)
This commit is contained in:
parent
a0983b67f9
commit
07edf784fa
12
evrpc.c
12
evrpc.c
@ -444,6 +444,18 @@ error:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evrpc_get_request(struct evrpc_req_generic *req)
|
||||||
|
{
|
||||||
|
return req->request;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
evrpc_get_reply(struct evrpc_req_generic *req)
|
||||||
|
{
|
||||||
|
return req->reply;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
evrpc_request_done_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res)
|
evrpc_request_done_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res)
|
||||||
{
|
{
|
||||||
|
@ -259,6 +259,10 @@ struct evrpc_request_wrapper *evrpc_make_request_ctx(
|
|||||||
/** completes the server response to an rpc request */
|
/** completes the server response to an rpc request */
|
||||||
void evrpc_request_done(struct evrpc_req_generic *req);
|
void evrpc_request_done(struct evrpc_req_generic *req);
|
||||||
|
|
||||||
|
/** accessors for request and reply */
|
||||||
|
void *evrpc_get_request(struct evrpc_req_generic *req);
|
||||||
|
void *evrpc_get_reply(struct evrpc_req_generic *req);
|
||||||
|
|
||||||
/** Creates the reply to an RPC request
|
/** Creates the reply to an RPC request
|
||||||
*
|
*
|
||||||
* EVRPC_REQUEST_DONE is used to answer a request; the reply is expected
|
* EVRPC_REQUEST_DONE is used to answer a request; the reply is expected
|
||||||
|
Loading…
x
Reference in New Issue
Block a user