diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-06-01 13:41:41 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-06-01 13:41:41 +0100 |
commit | ce129b96c7684d4270a7fae58ba5a9002837835c (patch) | |
tree | c37b0103f76668fe0a3b6ff23e4cb6873e240124 | |
parent | 30d3969c22ef22ae5fd455a019ab0879c28f43fb (diff) | |
download | prosody-ce129b96c7684d4270a7fae58ba5a9002837835c.tar.gz prosody-ce129b96c7684d4270a7fae58ba5a9002837835c.zip |
net.server_select: Pass conn/handler to readbuffer/sendbuffer
The internal implementations don't use it, but this causes onreadable
and onwritable of watchfd to receive the conn as they do in other
backends.
-rw-r--r-- | net/server_select.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/server_select.lua b/net/server_select.lua index de2556f0..a2515d59 100644 --- a/net/server_select.lua +++ b/net/server_select.lua @@ -384,7 +384,7 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport _readlistlen = removesocket( _readlist, socket, _readlistlen ) _readtimes[ handler ] = nil if bufferqueuelen ~= 0 then - handler.sendbuffer() -- Try now to send any outstanding data + handler:sendbuffer() -- Try now to send any outstanding data if bufferqueuelen ~= 0 then -- Still not empty, so we'll try again later if handler then handler.write = nil -- ... but no further writing allowed @@ -752,7 +752,7 @@ local function link(sender, receiver, buffersize) local sender_locked; local _sendbuffer = receiver.sendbuffer; function receiver.sendbuffer() - _sendbuffer(); + _sendbuffer(receiver); if sender_locked and receiver.bufferlen() < buffersize then sender:lock_read(false); -- Unlock now sender_locked = nil; @@ -962,7 +962,7 @@ loop = function(once) -- this is the main loop of the program for _, socket in ipairs( read ) do -- receive data local handler = _socketlist[ socket ] if handler then - handler.readbuffer( ) + handler:readbuffer( ) else closesocket( socket ) out_put "server.lua: found no handler and closed socket (readlist)" -- this can happen @@ -971,7 +971,7 @@ loop = function(once) -- this is the main loop of the program for _, socket in ipairs( write ) do -- send data waiting in writequeues local handler = _socketlist[ socket ] if handler then - handler.sendbuffer( ) + handler:sendbuffer( ) else closesocket( socket ) out_put "server.lua: found no handler and closed socket (writelist)" -- this should not happen |