Software /
code /
prosody
Changeset
9498:cc593002f2e2
net.server_epoll: Check return conditions of early socket setup
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 12 Oct 2018 17:28:08 +0200 |
parents | 9497:183ff7a8051b |
children | 9499:36e379f058c8 |
files | net/server_epoll.lua |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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