Diff

core/s2smanager.lua @ 231:24bcdaacc0bf

Prevent slow connects for s2s from blocking for so long
author Matthew Wild <mwild1@gmail.com>
date Sun, 09 Nov 2008 20:14:58 +0000
parent 227:211c2e04c82b
child 233:23585c323daa
line wrap: on
line diff
--- a/core/s2smanager.lua	Sun Nov 09 05:24:47 2008 +0500
+++ b/core/s2smanager.lua	Sun Nov 09 20:14:58 2008 +0000
@@ -78,6 +78,7 @@
 		local conn, handler = socket.tcp()
 		--FIXME: Below parameters (ports/ip) are incorrect (use SRV)
 		to_host = srvmap[to_host] or to_host;
+		conn:settimeout(0.1);
 		conn:connect(to_host, 5269);
 		conn = wraptlsclient(cl, conn, to_host, 5269, 0, 1, hosts[from_host].ssl_ctx );
 		host_session.conn = conn;