Lines Matching refs:rpc_state
262 struct evrpc_req_generic *rpc_state = NULL; in evrpc_request_cb() local
278 rpc_state = calloc(1, sizeof(struct evrpc_req_generic)); in evrpc_request_cb()
279 if (rpc_state == NULL) in evrpc_request_cb()
283 rpc_state->request = rpc->request_new(); in evrpc_request_cb()
284 if (rpc_state->request == NULL) in evrpc_request_cb()
287 rpc_state->rpc = rpc; in evrpc_request_cb()
290 rpc_state->request, req->input_buffer) == -1) { in evrpc_request_cb()
297 rpc_state->reply = rpc->reply_new(); in evrpc_request_cb()
298 if (rpc_state->reply == NULL) in evrpc_request_cb()
301 rpc_state->http_req = req; in evrpc_request_cb()
302 rpc_state->done = evrpc_request_done; in evrpc_request_cb()
305 rpc->cb(rpc_state, rpc->cb_arg); in evrpc_request_cb()
310 evrpc_reqstate_free(rpc_state); in evrpc_request_cb()
316 evrpc_reqstate_free(struct evrpc_req_generic* rpc_state) in evrpc_reqstate_free() argument
319 if (rpc_state != NULL) { in evrpc_reqstate_free()
320 struct evrpc *rpc = rpc_state->rpc; in evrpc_reqstate_free()
322 if (rpc_state->request != NULL) in evrpc_reqstate_free()
323 rpc->request_free(rpc_state->request); in evrpc_reqstate_free()
324 if (rpc_state->reply != NULL) in evrpc_reqstate_free()
325 rpc->reply_free(rpc_state->reply); in evrpc_reqstate_free()
326 free(rpc_state); in evrpc_reqstate_free()
331 evrpc_request_done(struct evrpc_req_generic* rpc_state) in evrpc_request_done() argument
333 struct evhttp_request *req = rpc_state->http_req; in evrpc_request_done()
334 struct evrpc *rpc = rpc_state->rpc; in evrpc_request_done()
337 if (rpc->reply_complete(rpc_state->reply) == -1) { in evrpc_request_done()
348 rpc->reply_marshal(data, rpc_state->reply); in evrpc_request_done()
365 evrpc_reqstate_free(rpc_state); in evrpc_request_done()
372 evrpc_reqstate_free(rpc_state); in evrpc_request_done()