Mercurial > prosody-hg
comparison net/server_epoll.lua @ 13571:ca041359c045
net.server_epoll: Don't try to flush buffer on closed connections
Attempt to fix a bug where connections are somehow closed twice, leading
to bad things happening elsewhere.
With LuaSec, closed connections are generally already too closed to
write anything to anyway since it does not support unidirectional
shutdown.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 19 Nov 2024 00:41:02 +0100 |
| parents | 9b9b224aa3f8 |
| children | a08065207ef0 |
comparison
equal
deleted
inserted
replaced
| 13570:9b9b224aa3f8 | 13571:ca041359c045 |
|---|---|
| 506 self:onconnect(); | 506 self:onconnect(); |
| 507 self:onincoming(partial, err); | 507 self:onincoming(partial, err); |
| 508 end | 508 end |
| 509 if err == "closed" and self._connected then | 509 if err == "closed" and self._connected then |
| 510 self:debug("Connection closed by remote"); | 510 self:debug("Connection closed by remote"); |
| 511 self:close(err); | 511 self:on("disconnect", err); |
| 512 self:destroy(); | |
| 512 return; | 513 return; |
| 513 elseif err ~= "timeout" then | 514 elseif err ~= "timeout" then |
| 514 self:debug("Read error, closing (%s)", err); | 515 self:debug("Read error, closing (%s)", err); |
| 515 self:on("disconnect", err); | 516 self:on("disconnect", err); |
| 516 self:destroy(); | 517 self:destroy(); |
