# HG changeset patch # User Kim Alvefur # Date 1471530488 -7200 # Node ID 138f16eb39fbd86899424c3bab1fb51e8696a90e # Parent fd07ab702f83359ad2307b8620326a518624da80 net.server_epoll: Improve syntax diff -r fd07ab702f83 -r 138f16eb39fb net/server_epoll.lua --- a/net/server_epoll.lua Thu Aug 18 16:12:28 2016 +0200 +++ b/net/server_epoll.lua Thu Aug 18 16:28:08 2016 +0200 @@ -293,7 +293,7 @@ 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 @@ writebuffer = {}; tls = tls; }, interface_mt); + if client.getpeername then conn.peername, conn.peerport = client:getpeername(); end