aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-07-08 17:57:44 +0200
committerKim Alvefur <zash@zash.se>2021-07-08 17:57:44 +0200
commitb40b79873c9fd79c5fa0bfc1533619a384b26e83 (patch)
tree2ae675766eb80edea96a00324380f835a8170f97 /net
parent852e44959d04b56cbf3c761b1ab5e0547ae05cc7 (diff)
downloadprosody-b40b79873c9fd79c5fa0bfc1533619a384b26e83.tar.gz
prosody-b40b79873c9fd79c5fa0bfc1533619a384b26e83.zip
net.server_epoll: Immediately attempt to read from newly accepted connections
This may speed up client-first protocols (e.g. XMPP, HTTP and TLS) when the first client data already arrived by the time we accept() it. If LuaSocket supported TCP_DEFER_ACCEPT we could use that to further increase the chance that there's already data to handle. In case no data has arrived, no harm should be done, :onreadable would simply set the read timeout and we'll get back to it once there is something to handle.
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index d4a08d3d..d2a1759b 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -698,8 +698,8 @@ function interface:onacceptable()
client:starttls(self.tls_ctx);
else
client:add(true, false);
- client:setreadtimeout();
client:onconnect();
+ client:onreadable();
end
end