Prevent slow connects for s2s from blocking for so long
authorMatthew Wild <mwild1@gmail.com>
Sun, 9 Nov 2008 20:14:58 +0000 (20:14 +0000)
committerMatthew Wild <mwild1@gmail.com>
Sun, 9 Nov 2008 20:14:58 +0000 (20:14 +0000)
core/s2smanager.lua

index 2f2f1d92a200b7f00ae2bb523480c076905290a2..76edc8afd8b9c43075de14ddd48b3590442128c8 100644 (file)
@@ -78,6 +78,7 @@ function new_outgoing(from_host, to_host)
                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;