Software / code / prosody
Comparison
net/server_select.lua @ 11043:d105e787f5ed
net.server_select: Fix traceback (thanks eta)
The `socket` here is unreferenced on disconnect. Calling :resume_writes
after that causes an error when `addsocket()` tries to use it as a table
index.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 23 Aug 2020 22:19:29 +0200 |
| parent | 10852:2e48aebdb915 |
| child | 11068:988ddd57e851 |
comparison
equal
deleted
inserted
replaced
| 11042:8a243ab49cb5 | 11043:d105e787f5ed |
|---|---|
| 509 _writetimes[ handler ] = nil | 509 _writetimes[ handler ] = nil |
| 510 nosend = true | 510 nosend = true |
| 511 end | 511 end |
| 512 handler.resume_writes = function (self) | 512 handler.resume_writes = function (self) |
| 513 nosend = false | 513 nosend = false |
| 514 if bufferlen > 0 then | 514 if bufferlen > 0 and socket then |
| 515 _sendlistlen = addsocket(_sendlist, socket, _sendlistlen) | 515 _sendlistlen = addsocket(_sendlist, socket, _sendlistlen) |
| 516 end | 516 end |
| 517 end | 517 end |
| 518 | 518 |
| 519 local _readbuffer = function( ) -- this function reads data | 519 local _readbuffer = function( ) -- this function reads data |