# HG changeset patch # User Kim Alvefur # Date 1626389862 -7200 # Node ID 194469fb46f906700d9d574348173ac587eaf3e7 # Parent 6efbcd52db210956d1de3636f3e9044a3e31d3d8 net.server_epoll: Wrap LuaSocket object earlier to reuse option setting method Since it provides some protection and error handling in the form of logging. diff -r 6efbcd52db21 -r 194469fb46f9 net/server_epoll.lua --- a/net/server_epoll.lua Fri Jul 16 00:56:45 2021 +0200 +++ b/net/server_epoll.lua Fri Jul 16 00:57:42 2021 +0200 @@ -969,12 +969,12 @@ if not conn then return conn, err; end local ok, err = conn:settimeout(0); if not ok then return ok, err; end + local client = wrapsocket(conn, nil, read_size, listeners, tls_ctx, extra) if cfg.tcp_fastopen then - pcall(conn.setoption, conn, "tcp-fastopen-connect", 1); + client:setoption("tcp-fastopen-connect", 1); end local ok, err = conn:setpeername(addr, port); if not ok and err ~= "timeout" then return ok, err; end - local client = wrapsocket(conn, nil, read_size, listeners, tls_ctx, extra) client:updatenames(); local ok, err = client:init(); if not client.peername then