summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--proxy_lua.c2
-rw-r--r--t/proxyconfig.t6
2 files changed, 7 insertions, 1 deletions
diff --git a/proxy_lua.c b/proxy_lua.c
index 85de700..7f969c5 100644
--- a/proxy_lua.c
+++ b/proxy_lua.c
@@ -378,7 +378,7 @@ static mcp_backend_wrap_t *_mcplib_make_backendconn(lua_State *L, mcp_backend_la
}
#endif
- lua_pushvalue(L, 4); // push the label string back to the top.
+ lua_pushvalue(L, -2); // push the label string back to the top.
// Add this new backend connection to the object cache.
lua_pushvalue(L, -2); // copy the backend reference to the top.
// set our new backend wrapper object into the reference table.
diff --git a/t/proxyconfig.t b/t/proxyconfig.t
index 73b0169..e839bd8 100644
--- a/t/proxyconfig.t
+++ b/t/proxyconfig.t
@@ -265,6 +265,12 @@ is(<$watcher>, "OK\r\n", "watcher enabled");
push(@cli, $p);
}
+ @readable = $s->can_read(0.25);
+ is(scalar @readable, 0, "no listeners should be active pre-reload");
+ $p_srv->reload();
+ wait_reload($watcher);
+ @readable = $s->can_read(0.25);
+ is(scalar @readable, 0, "no listeners should be active post-reload");
}
###