# HG changeset patch # User Kim Alvefur # Date 1539358088 -7200 # Node ID cc593002f2e2e40921f4fc42784dd8a4c84bc6ea # Parent 183ff7a8051bac744abad053f2ef6f5de3639f07 net.server_epoll: Check return conditions of early socket setup diff -r 183ff7a8051b -r cc593002f2e2 net/server_epoll.lua --- a/net/server_epoll.lua Fri Oct 12 16:26:19 2018 +0200 +++ b/net/server_epoll.lua Fri Oct 12 17:28:08 2018 +0200 @@ -643,8 +643,10 @@ return nil, "invalid socket type"; end local conn, err = create(); - conn:settimeout(0); - conn:connect(addr, port); + local ok, err = conn:settimeout(0); + if not ok then return ok, err; end + local ok, err = conn:connect(addr, port); + if not ok and err ~= "timeout" then return ok, err; end local client = wrapsocket(conn, nil, read_size, listeners, tls_ctx) local ok, err = client:init(); if not ok then return ok, err; end