# HG changeset patch # User Kim Alvefur # Date 1489161561 -3600 # Node ID 924354a35a0219f21158681ebf3e88dd5fcc2709 # Parent 95e16696ef8a7abe1a85e87e9fcae46ee6d178b1# Parent 1c6a0760630952c8f053ad4135dc0d9996f4ae90 Merge 0.10->trunk diff -r 95e16696ef8a -r 924354a35a02 plugins/mod_blocklist.lua --- a/plugins/mod_blocklist.lua Tue Mar 07 22:44:12 2017 +0100 +++ b/plugins/mod_blocklist.lua Fri Mar 10 16:59:21 2017 +0100 @@ -228,8 +228,11 @@ -- Buggy clients module:hook("iq-error/self/blocklist-push", function (event) + local origin, stanza = event.origin, event.stanza; local _, condition, text = event.stanza:get_error(); - (event.origin.log or module._log)("warn", "Client returned an error in response to notification from mod_%s: %s%s%s", module.name, condition, text and ": " or "", text or ""); + local log = (origin.log or module._log); + log("warn", "Client returned an error in response to notification from mod_%s: %s%s%s", + module.name, condition, text and ": " or "", text or ""); return true; end); diff -r 95e16696ef8a -r 924354a35a02 util-src/crand.c --- a/util-src/crand.c Tue Mar 07 22:44:12 2017 +0100 +++ b/util-src/crand.c Fri Mar 10 16:59:21 2017 +0100 @@ -100,7 +100,7 @@ luaL_checkversion(L); #endif - lua_newtable(L); + lua_createtable(L, 0, 2); lua_pushcfunction(L, Lrandom); lua_setfield(L, -2, "bytes"); diff -r 95e16696ef8a -r 924354a35a02 util-src/net.c --- a/util-src/net.c Tue Mar 07 22:44:12 2017 +0100 +++ b/util-src/net.c Fri Mar 10 16:59:21 2017 +0100 @@ -134,7 +134,7 @@ { NULL, NULL } }; - lua_newtable(L); + lua_createtable(L, 0, 1); luaL_setfuncs(L, exports, 0); return 1; } diff -r 95e16696ef8a -r 924354a35a02 util-src/pposix.c --- a/util-src/pposix.c Tue Mar 07 22:44:12 2017 +0100 +++ b/util-src/pposix.c Fri Mar 10 16:59:21 2017 +0100 @@ -660,7 +660,7 @@ return 2; } - lua_newtable(L); + lua_createtable(L, 0, 6); lua_pushstring(L, uname_info.sysname); lua_setfield(L, -2, "sysname"); lua_pushstring(L, uname_info.nodename); @@ -709,7 +709,7 @@ #ifdef WITH_MALLINFO int lc_meminfo(lua_State *L) { struct mallinfo info = mallinfo(); - lua_newtable(L); + lua_createtable(L, 0, 5); /* This is the total size of memory allocated with sbrk by malloc, in bytes. */ lua_pushinteger(L, info.arena); lua_setfield(L, -2, "allocated"); diff -r 95e16696ef8a -r 924354a35a02 util-src/ringbuffer.c --- a/util-src/ringbuffer.c Tue Mar 07 22:44:12 2017 +0100 +++ b/util-src/ringbuffer.c Fri Mar 10 16:59:21 2017 +0100 @@ -187,7 +187,7 @@ lua_pushcfunction(L, rb_length); lua_setfield(L, -2, "__len"); - lua_newtable(L); /* __index */ + lua_createtable(L, 0, 7); /* __index */ { lua_pushcfunction(L, rb_find); lua_setfield(L, -2, "find"); @@ -207,7 +207,7 @@ lua_setfield(L, -2, "__index"); } - lua_newtable(L); + lua_createtable(L, 0, 1); lua_pushcfunction(L, rb_new); lua_setfield(L, -2, "new"); return 1; diff -r 95e16696ef8a -r 924354a35a02 util-src/table.c --- a/util-src/table.c Tue Mar 07 22:44:12 2017 +0100 +++ b/util-src/table.c Fri Mar 10 16:59:21 2017 +0100 @@ -24,7 +24,7 @@ #if (LUA_VERSION_NUM > 501) luaL_checkversion(L); #endif - lua_newtable(L); + lua_createtable(L, 0, 2); lua_pushcfunction(L, Lcreate_table); lua_setfield(L, -2, "create"); lua_pushcfunction(L, Lpack);