From 4bb375ca18e8d16f872d3bb89f949a2844e6c82f Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER Date: Wed, 26 Aug 2015 08:42:21 +0200 Subject: [PATCH] MEDIUM: lua: turns txn:close into txn:done The function txn:close() must be terminal because it demands the session destruction. This patch renames this function to "done()" to be much clearer about the fact that it is a final operation. --- src/hlua.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hlua.c b/src/hlua.c index 7669f96e5..b88f5e469 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -3643,7 +3643,7 @@ __LJMP static int hlua_txn_set_mark(lua_State *L) /* This function is an Lua binding that send pending data * to the client, and close the stream interface. */ -__LJMP static int hlua_txn_close(lua_State *L) +__LJMP static int hlua_txn_done(lua_State *L) { struct hlua_txn *htxn; struct channel *ic, *oc; @@ -3665,6 +3665,8 @@ __LJMP static int hlua_txn_close(lua_State *L) channel_shutr_now(oc); htxn->s->txn->req.chn->analysers = 0; + + WILL_LJMP(hlua_done(L)); return 0; } @@ -4968,7 +4970,7 @@ void hlua_init(void) hlua_class_function(gL.T, "get_priv", hlua_get_priv); hlua_class_function(gL.T, "set_var", hlua_set_var); hlua_class_function(gL.T, "get_var", hlua_get_var); - hlua_class_function(gL.T, "close", hlua_txn_close); + hlua_class_function(gL.T, "done", hlua_txn_done); hlua_class_function(gL.T, "set_loglevel",hlua_txn_set_loglevel); hlua_class_function(gL.T, "set_tos", hlua_txn_set_tos); hlua_class_function(gL.T, "set_mark", hlua_txn_set_mark);