Software /
code /
prosody
Comparison
net/server_epoll.lua @ 8541:8186114329d6
net.server_epoll: Remove special casing for having sent an empty write buffer because the wantwrite flag must be unset regardless
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 24 Feb 2018 14:36:44 +0100 |
parent | 8540:ba9fd886b34d |
child | 8542:8c39ec8e6018 |
comparison
equal
deleted
inserted
replaced
8540:ba9fd886b34d | 8541:8186114329d6 |
---|---|
336 function interface:onwriteable() | 336 function interface:onwriteable() |
337 local buffer = self.writebuffer; | 337 local buffer = self.writebuffer; |
338 local data = t_concat(buffer); | 338 local data = t_concat(buffer); |
339 local ok, err, partial = self.conn:send(data); | 339 local ok, err, partial = self.conn:send(data); |
340 if ok then | 340 if ok then |
341 if data ~= "" then | 341 self:setflags(nil, false); |
342 for i = #buffer, 1, -1 do | 342 for i = #buffer, 1, -1 do |
343 buffer[i] = nil; | 343 buffer[i] = nil; |
344 end | 344 end |
345 self:setflags(nil, false); | 345 self:setwritetimeout(false); |
346 self:setwritetimeout(false); | 346 self:ondrain(); -- Be aware of writes in ondrain |
347 self:ondrain(); -- Be aware of writes in ondrain | |
348 end | |
349 self:onconnect(); | 347 self:onconnect(); |
350 return; | 348 return; |
351 elseif partial then | 349 elseif partial then |
352 buffer[1] = data:sub(partial+1); | 350 buffer[1] = data:sub(partial+1); |
353 for i = #buffer, 2, -1 do | 351 for i = #buffer, 2, -1 do |