Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix socket fd reclose #657

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

lvl-coding
Copy link

When both active mode and passive mode are using data channels, the socket fd used to establish the connection in active mode is not released, which will cause the socket fd reused by the data channel in passive mode to be closed by mistake when the user logs out, resulting in data writing failure.

This pull request includes a small change to the pyftpdlib/handlers.py file. The change modifies the handle_connect method to set _fileno to None when the connection is established.

  • pyftpdlib/handlers.py: Modified the handle_connect method to set _fileno to None when the connection is established.

Signed-off-by: masterLv <909173273@qq.com>
@giampaolo
Copy link
Owner

I think it's better if you do this in the del_channel method.
Also can you please update HISTORY.rst describing what this fixes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants