Also, assuming this is not a bug with pyftpdlib, the only other reason
I see is that it's the client which suddenly stops transmitting data,
in which case the server is doing the right thing.
--- Giampaolo
2011/2/10 tm <tmug...@gmail.com>:
> --
> You received this message because you are subscribed to the "Python FTP server library" project group:
> http://code.google.com/p/pyftpdlib/
> To post to this group, send email to pyft...@googlegroups.com
> To unsubscribe from this group, send email to pyftpdlib-...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/pyftpdlib
import socket
from pyftpdlib import ftpserver
class DTPHandler(ftpserver.DTPHandler):
def __init__(self, sock, cmd_channel):
ftpserver.DTPHandler.__init__(self, sock, cmd_channel)
if self.connected:
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
class FTPHandler(ftpserver.FTPHandler):
dtp_handler = CustomizedDTPHandler
def __init__(self, conn, server):
ftpserver.FTPHandler.__init__(self, conn, server)
if self.connected:
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
authorizer = ftpserver.DummyAuthorizer()
authorizer.add_user('user', '12345', homedir='.', perm='elradfmw')
handler = FTPHandler
handler.authorizer = authorizer
server = ftpserver.FTPServer(("", 21), handler)
server.serve_forever()
Let me know if it helps,
--- Giampaolo
2011/2/11 tm <tmug...@gmail.com>:
---- Giampaolo
2011/2/12 Giampaolo Rodolà <g.ro...@gmail.com>: