Comparison

core/s2smanager.lua @ 4510:b827401581c5

s2smanager: Fix traceback when socket.tcp6 isn't available
author Matthew Wild <mwild1@gmail.com>
date Sat, 25 Feb 2012 02:03:26 +0000
parent 4494:694491140a67
child 4512:eb97612bf42b
comparison
equal deleted inserted replaced
4509:e886bd7c2f6c 4510:b827401581c5
430 local from_host, to_host = host_session.from_host, host_session.to_host; 430 local from_host, to_host = host_session.from_host, host_session.to_host;
431 431
432 local conn, handler; 432 local conn, handler;
433 if connect_host.proto == "IPv4" then 433 if connect_host.proto == "IPv4" then
434 conn, handler = socket.tcp(); 434 conn, handler = socket.tcp();
435 else 435 elseif socket.tcp6 then
436 conn, handler = socket.tcp6(); 436 conn, handler = socket.tcp6();
437 end 437 end
438 438
439 if not conn then 439 if not conn then
440 log("warn", "Failed to create outgoing connection, system error: %s", handler); 440 log("warn", "Failed to create outgoing connection, system error: %s", handler);