Software /
code /
prosody
Comparison
net/server_epoll.lua @ 7550:8c2bc1b6d84a
net.server_epoll: Remove last traces of code for bypassing buffering on writable sockets
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 10 Aug 2016 20:47:40 +0200 |
parent | 7547:b327322ce2dd |
child | 7551:838212918f11 |
comparison
equal
deleted
inserted
replaced
7549:d5f8a56eda4c | 7550:8c2bc1b6d84a |
---|---|
251 self:setflags(nil, false); | 251 self:setflags(nil, false); |
252 self:setwritetimeout(false); | 252 self:setwritetimeout(false); |
253 else | 253 else |
254 self:setwritetimeout(); | 254 self:setwritetimeout(); |
255 end | 255 end |
256 self._writable = true; | |
257 elseif partial then | 256 elseif partial then |
258 buffer[1] = data:sub(partial+1) | 257 buffer[1] = data:sub(partial+1) |
259 for i = #buffer, 2, -1 do | 258 for i = #buffer, 2, -1 do |
260 buffer[i] = nil; | 259 buffer[i] = nil; |
261 end | 260 end |
262 self:setwritetimeout(); | 261 self:setwritetimeout(); |
263 self._writable = false; | |
264 end | 262 end |
265 if err == "wantwrite" or err == "timeout" then | 263 if err == "wantwrite" or err == "timeout" then |
266 self:setflags(nil, true); | 264 self:setflags(nil, true); |
267 elseif err == "wantread" then | 265 elseif err == "wantread" then |
268 self:setflags(true, nil); | 266 self:setflags(true, nil); |
288 if buffer then | 286 if buffer then |
289 t_insert(buffer, data); | 287 t_insert(buffer, data); |
290 else | 288 else |
291 self.writebuffer = { data }; | 289 self.writebuffer = { data }; |
292 end | 290 end |
293 if self._writable and false then | 291 self:setwritetimeout(); |
294 self:onwriteable(); | 292 self:setflags(nil, true); |
295 else | |
296 self:setwritetimeout(); | |
297 self:setflags(nil, true); | |
298 end | |
299 return #data; | 293 return #data; |
300 end | 294 end |
301 interface.send = interface.write; | 295 interface.send = interface.write; |
302 | 296 |
303 function interface:close() | 297 function interface:close() |