• Home
  • Raw
  • Download

Lines Matching refs:rpc_state

288 	struct evrpc_req_generic *rpc_state = NULL;  in evrpc_request_cb()  local
295 rpc_state = mm_calloc(1, sizeof(struct evrpc_req_generic)); in evrpc_request_cb()
296 if (rpc_state == NULL) in evrpc_request_cb()
298 rpc_state->rpc = rpc; in evrpc_request_cb()
299 rpc_state->http_req = req; in evrpc_request_cb()
300 rpc_state->rpc_data = NULL; in evrpc_request_cb()
305 evrpc_hook_associate_meta_(&rpc_state->hook_meta, req->evcon); in evrpc_request_cb()
311 rpc_state, req, req->input_buffer); in evrpc_request_cb()
316 evrpc_pause_request(rpc->base, rpc_state, in evrpc_request_cb()
328 evrpc_request_cb_closure(rpc_state, EVRPC_CONTINUE); in evrpc_request_cb()
332 evrpc_reqstate_free_(rpc_state); in evrpc_request_cb()
340 struct evrpc_req_generic *rpc_state = arg; in evrpc_request_cb_closure() local
344 EVUTIL_ASSERT(rpc_state); in evrpc_request_cb_closure()
345 rpc = rpc_state->rpc; in evrpc_request_cb_closure()
346 req = rpc_state->http_req; in evrpc_request_cb_closure()
352 rpc_state->request = rpc->request_new(rpc->request_new_arg); in evrpc_request_cb_closure()
353 if (rpc_state->request == NULL) in evrpc_request_cb_closure()
357 rpc_state->request, req->input_buffer) == -1) { in evrpc_request_cb_closure()
364 rpc_state->reply = rpc->reply_new(rpc->reply_new_arg); in evrpc_request_cb_closure()
365 if (rpc_state->reply == NULL) in evrpc_request_cb_closure()
369 rpc->cb(rpc_state, rpc->cb_arg); in evrpc_request_cb_closure()
374 evrpc_reqstate_free_(rpc_state); in evrpc_request_cb_closure()
381 evrpc_reqstate_free_(struct evrpc_req_generic* rpc_state) in evrpc_reqstate_free_() argument
384 EVUTIL_ASSERT(rpc_state != NULL); in evrpc_reqstate_free_()
385 rpc = rpc_state->rpc; in evrpc_reqstate_free_()
388 if (rpc_state->hook_meta != NULL) in evrpc_reqstate_free_()
389 evrpc_hook_context_free_(rpc_state->hook_meta); in evrpc_reqstate_free_()
390 if (rpc_state->request != NULL) in evrpc_reqstate_free_()
391 rpc->request_free(rpc_state->request); in evrpc_reqstate_free_()
392 if (rpc_state->reply != NULL) in evrpc_reqstate_free_()
393 rpc->reply_free(rpc_state->reply); in evrpc_reqstate_free_()
394 if (rpc_state->rpc_data != NULL) in evrpc_reqstate_free_()
395 evbuffer_free(rpc_state->rpc_data); in evrpc_reqstate_free_()
396 mm_free(rpc_state); in evrpc_reqstate_free_()
403 evrpc_request_done(struct evrpc_req_generic *rpc_state) in evrpc_request_done() argument
408 EVUTIL_ASSERT(rpc_state); in evrpc_request_done()
410 req = rpc_state->http_req; in evrpc_request_done()
411 rpc = rpc_state->rpc; in evrpc_request_done()
413 if (rpc->reply_complete(rpc_state->reply) == -1) { in evrpc_request_done()
418 if ((rpc_state->rpc_data = evbuffer_new()) == NULL) { in evrpc_request_done()
424 rpc->reply_marshal(rpc_state->rpc_data, rpc_state->reply); in evrpc_request_done()
429 evrpc_hook_associate_meta_(&rpc_state->hook_meta, req->evcon); in evrpc_request_done()
433 rpc_state, req, rpc_state->rpc_data); in evrpc_request_done()
438 if (evrpc_pause_request(rpc->base, rpc_state, in evrpc_request_done()
451 evrpc_request_done_closure(rpc_state, EVRPC_CONTINUE); in evrpc_request_done()
455 evrpc_reqstate_free_(rpc_state); in evrpc_request_done()
475 struct evrpc_req_generic *rpc_state = arg; in evrpc_request_done_closure() local
477 EVUTIL_ASSERT(rpc_state); in evrpc_request_done_closure()
478 req = rpc_state->http_req; in evrpc_request_done_closure()
488 evhttp_send_reply(req, HTTP_OK, "OK", rpc_state->rpc_data); in evrpc_request_done_closure()
490 evrpc_reqstate_free_(rpc_state); in evrpc_request_done_closure()
495 evrpc_reqstate_free_(rpc_state); in evrpc_request_done_closure()