Changeset

7970:924354a35a02

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Fri, 10 Mar 2017 16:59:21 +0100
parents 7967:95e16696ef8a (current diff) 7969:1c6a07606309 (diff)
children 7972:c29de6820fbb
files
diffstat 6 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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);
 
--- 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");
 
--- 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;
 }
--- 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");
--- 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;
--- 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);