Changeset

9642:e31053344231

mod_proxy65: Return an error if no port is open (fixes #1240)
author Kim Alvefur <zash@zash.se>
date Sun, 25 Nov 2018 13:14:05 +0100
parents 9544:cbd3b9d4c60b
children 9643:bb8486491b48
files plugins/mod_proxy65.lua
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_proxy65.lua	Wed Oct 24 17:13:49 2018 +0200
+++ b/plugins/mod_proxy65.lua	Sun Nov 25 13:14:05 2018 +0100
@@ -121,6 +121,12 @@
 			return true;
 		end
 
+		if not proxy_port then
+			module:log("warn", "Not listening on any port");
+			origin.send(st.error_reply(stanza, "wait", "item-not-found", "Not listening on any port"));
+			return true;
+		end
+
 		local sid = stanza.tags[1].attr.sid;
 		origin.send(st.reply(stanza):tag("query", {xmlns="http://jabber.org/protocol/bytestreams", sid=sid})
 			:tag("streamhost", {jid=host, host=proxy_address, port=proxy_port}));