From c0a2feef03a9b82e2227b572a8ad28b433ec1118 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 18 Aug 2016 16:28:08 +0200 Subject: net.server_epoll: Improve syntax --- net/server_epoll.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/server_epoll.lua b/net/server_epoll.lua index 39cd8a58..99561c18 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -293,7 +293,7 @@ function interface:onwriteable() self:ondrain(); -- Be aware of writes in ondrain return; elseif partial then - buffer[1] = data:sub(partial+1) + buffer[1] = data:sub(partial+1); for i = #buffer, 2, -1 do buffer[i] = nil; end @@ -416,6 +416,7 @@ local function wrapsocket(client, server, pattern, listeners, tls) -- luasocket writebuffer = {}; tls = tls; }, interface_mt); + if client.getpeername then conn.peername, conn.peerport = client:getpeername(); end -- cgit v1.2.3