Lines Matching refs:resp

595     mc_resp *resp = rctx->resp;  in proxy_return_rctx_cb()  local
606 resp->io_pending = NULL; in proxy_return_rctx_cb()
758 void proxy_out_errstring(mc_resp *resp, char *type, const char *str) { in proxy_out_errstring() argument
762 assert(resp != NULL); in proxy_out_errstring()
764 resp_reset(resp); in proxy_out_errstring()
775 char *w = resp->wbuf; in proxy_out_errstring()
783 resp_add_iov(resp, resp->wbuf, len + prefix_len + 2); in proxy_out_errstring()
791 static void _set_noreply_mode(mc_resp *resp, mcp_resp_t *r) { in _set_noreply_mode() argument
798 resp->skip = true; in _set_noreply_mode()
802 if (r->resp.code == MCMC_CODE_END) { in _set_noreply_mode()
803 resp->skip = true; in _set_noreply_mode()
804 } else if (r->cmd != CMD_MG && r->resp.code == MCMC_CODE_OK) { in _set_noreply_mode()
809 resp->skip = true; in _set_noreply_mode()
823 static void _proxy_run_tresp_to_resp(mc_resp *tresp, mc_resp *resp) { in _proxy_run_tresp_to_resp() argument
831 memcpy(resp->wbuf, tresp->wbuf, tresp->iov[0].iov_len); in _proxy_run_tresp_to_resp()
832 resp->tosend = 0; in _proxy_run_tresp_to_resp()
834 resp->iov[x] = tresp->iov[x]; in _proxy_run_tresp_to_resp()
835 resp->tosend += tresp->iov[x].iov_len; in _proxy_run_tresp_to_resp()
842 resp->iov[0].iov_base = resp->wbuf; in _proxy_run_tresp_to_resp()
844 resp->iovcnt = tresp->iovcnt; in _proxy_run_tresp_to_resp()
845 resp->chunked_total = tresp->chunked_total; in _proxy_run_tresp_to_resp()
846 resp->chunked_data_iov = tresp->chunked_data_iov; in _proxy_run_tresp_to_resp()
848 resp->request_id = tresp->request_id; in _proxy_run_tresp_to_resp()
849 resp->udp_sequence = tresp->udp_sequence; in _proxy_run_tresp_to_resp()
850 resp->udp_total = tresp->udp_total; in _proxy_run_tresp_to_resp()
851 resp->request_addr = tresp->request_addr; in _proxy_run_tresp_to_resp()
852 resp->request_addr_size = tresp->request_addr_size; in _proxy_run_tresp_to_resp()
853 resp->item = tresp->item; // will be populated if not extstore fetch in _proxy_run_tresp_to_resp()
855 resp->skip = tresp->skip; in _proxy_run_tresp_to_resp()
900 mc_resp *resp = rctx->resp; in proxy_run_rcontext() local
909 _set_noreply_mode(resp, r); in proxy_run_rcontext()
910 if (r->status != MCMC_OK && r->resp.type != MCMC_RESP_ERRMSG) { in proxy_run_rcontext()
911 proxy_out_errstring(resp, PROXY_SERVER_ERROR, "backend failure"); in proxy_run_rcontext()
915 _proxy_run_tresp_to_resp(tresp, resp); in proxy_run_rcontext()
920 resp->write_and_free = r->buf; in proxy_run_rcontext()
921 resp_add_iov(resp, r->buf, r->blen); in proxy_run_rcontext()
923 resp->wbytes = r->blen + r->extra; in proxy_run_rcontext()
924 resp->proxy_res = true; in proxy_run_rcontext()
934 memcpy(resp->wbuf, s, l); in proxy_run_rcontext()
935 resp_add_iov(resp, resp->wbuf, l); in proxy_run_rcontext()
938 proxy_out_errstring(resp, PROXY_SERVER_ERROR, "bad response"); in proxy_run_rcontext()
969 proxy_out_errstring(resp, PROXY_SERVER_ERROR, "bad request"); in proxy_run_rcontext()
992 proxy_out_errstring(resp, PROXY_SERVER_ERROR, "lua failure"); in proxy_run_rcontext()
1026 proxy_out_errstring(c->resp, PROXY_CLIENT_ERROR, "parsing request"); in proxy_process_command()
1088 proxy_out_errstring(c->resp, PROXY_CLIENT_ERROR, "malformed request"); in proxy_process_command()
1094 proxy_out_errstring(c->resp, PROXY_CLIENT_ERROR, "key too long"); in proxy_process_command()
1125 memcpy(c->resp->wbuf, ENDSTR, ENDLEN); in proxy_process_command()
1126 resp_add_iov(c->resp, c->resp->wbuf, ENDLEN); in proxy_process_command()
1139 proxy_out_errstring(c->resp, PROXY_CLIENT_ERROR, "request too long"); in proxy_process_command()
1161 proxy_out_errstring(c->resp, PROXY_SERVER_ERROR, "active request limit reached"); in proxy_process_command()
1172 proxy_out_errstring(c->resp, PROXY_SERVER_ERROR, "lua start failure"); in proxy_process_command()
1187 rctx->resp = c->resp; in proxy_process_command()
1211 proxy_out_errstring(c->resp, PROXY_SERVER_ERROR, "out of memory"); in proxy_process_command()