[projects/pld-ftp-admin] ftpiod: don't crash when a client connection breaks
arekm
arekm at pld-linux.org
Sat Oct 24 11:45:18 CEST 2026
commit 1bcccb626fa97cd1bcee936592ebeccac1c986b4
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Tue Oct 20 15:29:29 2026 +0200
ftpiod: don't crash when a client connection breaks
A failed recv() removed the connection twice.
modules/cons.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/modules/cons.py b/modules/cons.py
index dae0587..20f7517 100644
--- a/modules/cons.py
+++ b/modules/cons.py
@@ -24,13 +24,13 @@ class Connection:
newdata = None
try:
newdata = self.sock.recv(8192)
- except:
- self.destroy()
+ except OSError:
+ pass
if not newdata:
self.destroy()
- else:
- self.data = self.data + newdata.decode("utf-8")
+ return
+ self.data = self.data + newdata.decode("utf-8")
try:
cmds.parse(self)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/pld-ftp-admin.git/commitdiff/e14cb7d4d74f8bdd9368d9645ecaf49593cf6335
More information about the pld-cvs-commit
mailing list