Changeset

7542:0f92dc8e8b88

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Mon, 08 Aug 2016 16:41:09 +0200
parents 7536:3f8520b59677 (current diff) 7541:1d3f9da189b5 (diff)
children 7543:23a8a26e8912
files plugins/mod_c2s.lua plugins/mod_s2s/mod_s2s.lua
diffstat 4 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/net/http/server.lua	Sat Aug 06 11:58:01 2016 +0200
+++ b/net/http/server.lua	Mon Aug 08 16:41:09 2016 +0200
@@ -13,7 +13,7 @@
 local tostring = tostring;
 local cache = require "util.cache";
 local codes = require "net.http.codes";
-local blocksize = require "socket".BLOCKSIZE or 2048;
+local blocksize = 2^16;
 
 local _M = {};
 
--- a/plugins/mod_c2s.lua	Sat Aug 06 11:58:01 2016 +0200
+++ b/plugins/mod_c2s.lua	Mon Aug 08 16:41:09 2016 +0200
@@ -261,9 +261,9 @@
 	function session.data(data)
 		-- Parse the data, which will store stanzas in session.pending_stanzas
 		if data then
-		data = filter("bytes/in", data);
-		if data then
-			local ok, err = stream:feed(data);
+			data = filter("bytes/in", data);
+			if data then
+				local ok, err = stream:feed(data);
 				if not ok then
 					log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_"));
 					session:close("not-well-formed");
@@ -309,7 +309,10 @@
 end
 
 local function keepalive(event)
-	return event.session.send(' ');
+	local session = event.session;
+	if not session.notopen then
+		return event.session.send(' ');
+	end
 end
 
 function listener.associate_session(conn, session)
--- a/plugins/mod_s2s/mod_s2s.lua	Sat Aug 06 11:58:01 2016 +0200
+++ b/plugins/mod_s2s/mod_s2s.lua	Mon Aug 08 16:41:09 2016 +0200
@@ -673,8 +673,8 @@
 
 function listener.onreadtimeout(conn)
 	local session = sessions[conn];
-	local host = session.host or session.to_host;
 	if session then
+		local host = session.host or session.to_host;
 		return (hosts[host] or prosody).events.fire_event("s2s-read-timeout", { session = session });
 	end
 end
--- a/util-src/table.c	Sat Aug 06 11:58:01 2016 +0200
+++ b/util-src/table.c	Mon Aug 08 16:41:09 2016 +0200
@@ -7,10 +7,11 @@
 }
 
 static int Lpack(lua_State* L) {
+	int arg;
 	unsigned int n_args = lua_gettop(L);
 	lua_createtable(L, n_args, 1);
 	lua_insert(L, 1);
-	for(int arg = n_args; arg >= 1; arg--) {
+	for(arg = n_args; arg >= 1; arg--) {
 		lua_rawseti(L, 1, arg);
 	}
 	lua_pushinteger(L, n_args);