summaryrefslogtreecommitdiff
path: root/proxy_await.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2023-01-12 12:15:23 -0800
committerdormando <dormando@rydia.net>2023-01-12 13:50:55 -0800
commit6537cfe41ead9c81dd3e9c9f5d3929a050692cbd (patch)
tree021699f628b831dee45800ba913ec53ce88a8cf1 /proxy_await.c
parent0e87c6dd86d8a50ddd56fbce445fb18e498e7f5f (diff)
downloadmemcached-6537cfe41ead9c81dd3e9c9f5d3929a050692cbd.tar.gz
proxy: clean logic around lua yielding
We were duck typing the response code for a coroutine yield before. It would also pile random logic for overriding IO's in certain cases. This now makes everything explicit and more clear.
Diffstat (limited to 'proxy_await.c')
-rw-r--r--proxy_await.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/proxy_await.c b/proxy_await.c
index 582c3d5..3dfd16b 100644
--- a/proxy_await.c
+++ b/proxy_await.c
@@ -89,7 +89,8 @@ int mcplib_await(lua_State *L) {
aw->type = type;
P_DEBUG("%s: about to yield [len: %d]\n", __func__, n);
- return lua_yield(L, 1);
+ lua_pushinteger(L, MCP_YIELD_AWAIT);
+ return lua_yield(L, 2);
}
static void mcp_queue_await_io(conn *c, lua_State *Lc, mcp_request_t *rq, int await_ref, bool await_first) {