Software /
code /
prosody
Comparison
net/server_epoll.lua @ 7589:125e4f2e0b65
net.server_epoll: Return early on successful write
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 18 Aug 2016 16:06:18 +0200 |
parent | 7588:fd6ca110edce |
child | 7590:fd07ab702f83 |
comparison
equal
deleted
inserted
replaced
7588:fd6ca110edce | 7589:125e4f2e0b65 |
---|---|
287 buffer[i] = nil; | 287 buffer[i] = nil; |
288 end | 288 end |
289 self:setflags(nil, false); | 289 self:setflags(nil, false); |
290 self:setwritetimeout(false); | 290 self:setwritetimeout(false); |
291 self:ondrain(); -- Be aware of writes in ondrain | 291 self:ondrain(); -- Be aware of writes in ondrain |
292 return; | |
292 elseif partial then | 293 elseif partial then |
293 buffer[1] = data:sub(partial+1) | 294 buffer[1] = data:sub(partial+1) |
294 for i = #buffer, 2, -1 do | 295 for i = #buffer, 2, -1 do |
295 buffer[i] = nil; | 296 buffer[i] = nil; |
296 end | 297 end |