summaryrefslogtreecommitdiff
path: root/proto_proxy.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2022-04-06 16:59:18 -0700
committerdormando <dormando@rydia.net>2022-04-08 13:19:26 -0700
commit43a5d6832bce062587c9c088797f0eec46c1ded8 (patch)
treedc38f8278bb90a63a0d00e9fdb7da139565b97dd /proto_proxy.c
parent88e7960d21865d48f68b2463515dedde66cd9ae8 (diff)
downloadmemcached-43a5d6832bce062587c9c088797f0eec46c1ded8.tar.gz
proxy: replace proxycmds stream with proxyreqs
delete the magic logging and require mcp.log_req* be used if you want those types of entries to appear. keeps a separate data stream from "proxyuser" just in case that's useful. proxycmds wasn't able to get enough context to autogenerate useful log lines, so I'd rather not have it in there at all.
Diffstat (limited to 'proto_proxy.c')
-rw-r--r--proto_proxy.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/proto_proxy.c b/proto_proxy.c
index d557da5..60c50d6 100644
--- a/proto_proxy.c
+++ b/proto_proxy.c
@@ -496,7 +496,7 @@ static void _set_noreply_mode(mc_resp *resp, mcp_resp_t *r) {
case RESP_MODE_METAQUIET:
if (r->resp.code == MCMC_CODE_MISS) {
resp->skip = true;
- } else if (r->cmd[1] != 'g' && r->resp.code == MCMC_CODE_OK) {
+ } else if (r->cmd != CMD_MG && r->resp.code == MCMC_CODE_OK) {
// FIXME (v2): mcmc's parser needs to help us out a bit more
// here.
// This is a broken case in the protocol though; quiet mode
@@ -530,7 +530,6 @@ int proxy_run_coroutine(lua_State *Lc, mc_resp *resp, io_pending_proxy_t *p, con
int type = lua_type(Lc, 1);
if (type == LUA_TUSERDATA) {
mcp_resp_t *r = luaL_checkudata(Lc, 1, "mcp.response");
- LOGGER_LOG(NULL, LOG_PROXYCMDS, LOGGER_PROXY_RAW, NULL, r->start, r->cmd, r->resp.type, r->resp.code);
_set_noreply_mode(resp, r);
if (r->buf) {
// response set from C.
@@ -806,7 +805,6 @@ static void mcp_queue_io(conn *c, mc_resp *resp, int coro_ref, lua_State *Lc) {
memset(r, 0, sizeof(mcp_resp_t));
r->buf = NULL;
r->blen = 0;
- r->start = rq->start; // need to inherit the original start time.
// Set noreply mode.
// TODO (v2): the response "inherits" the request's noreply mode, which isn't
// strictly correct; we should inherit based on the request that spawned
@@ -829,15 +827,7 @@ static void mcp_queue_io(conn *c, mc_resp *resp, int coro_ref, lua_State *Lc) {
r->mode = RESP_MODE_NORMAL;
}
- int x;
- int end = rq->pr.reqlen-2 > RESP_CMD_MAX ? RESP_CMD_MAX : rq->pr.reqlen-2;
- for (x = 0; x < end; x++) {
- if (rq->pr.request[x] == ' ') {
- break;
- }
- r->cmd[x] = rq->pr.request[x];
- }
- r->cmd[x] = '\0';
+ r->cmd = rq->pr.command;
luaL_getmetatable(Lc, "mcp.response");
lua_setmetatable(Lc, -2);