Skip to content

ftp, move listen handling to socket filter - #14798

Closed
icing wants to merge 3 commits into
curl:masterfrom
icing:ftp-socket-accept-move
Closed

ftp, move listen handling to socket filter#14798
icing wants to merge 3 commits into
curl:masterfrom
icing:ftp-socket-accept-move

Conversation

@icing

@icing icing commented Sep 5, 2024

Copy link
Copy Markdown
Contributor

Move the listen/accept handling of the FTP active data connection into the socket filter and monitor 'connected' status of that as with passive connections - more or less.

The advantage is that the socket filter now reports being connected only when the server has actually called and accept() has been done. This enables to bootstrap the filter chain on the data connection just like any other. A require SSL filter can then be added right at the start and does not need to be patched in later.

Still, the active connection keeps on needing special handling in ftp.c as the control connection needs to be monitored while waiting as the server might send error responses this way. So, things did not turn out quite as squeaky clean as hoped for, but still seems better to do that way.

@bagder bagder added the FTP label Sep 6, 2024
@icing

icing commented Sep 6, 2024

Copy link
Copy Markdown
Contributor Author

@bagder: I propose to merge this only after the next release.

@bagder

bagder commented Oct 4, 2024

Copy link
Copy Markdown
Member

@icing if you take a look at the conflict, we should probably merge this!

icing added 3 commits October 4, 2024 18:49
Move the listen/accept handling of the FTP active data connection
into the socket filter and monitor 'connected' status of that as
with passive connections - more or less.

The advantage is that the socket filter now reports being connected
only when the server has actually called and accept() has been done.
This enables to bootstrap the filter chain on the data connection
just like any other. A require SSL filter can then be added right
at the start and does not need to be patched in later.

Still, the active connection keeps on needing special handling in
ftp.c as the control connection needs to be monitored while waiting
as the server might send error responses this way. So, things did
not turn out quite as squeaky clean as hoped for, but still seems
better to do that way.
@icing
icing force-pushed the ftp-socket-accept-move branch from 455c271 to 1895b4d Compare October 4, 2024 16:59
@icing

icing commented Oct 4, 2024

Copy link
Copy Markdown
Contributor Author

@icing if you take a look at the conflict, we should probably merge this!

Done.

@bagder bagder closed this in a7ccd02 Oct 13, 2024
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
Move the listen/accept handling of the FTP active data connection
into the socket filter and monitor 'connected' status of that as
with passive connections - more or less.

The advantage is that the socket filter now reports being connected
only when the server has actually called and accept() has been done.
This enables to bootstrap the filter chain on the data connection
just like any other. A require SSL filter can then be added right
at the start and does not need to be patched in later.

Still, the active connection keeps on needing special handling in
ftp.c as the control connection needs to be monitored while waiting
as the server might send error responses this way. So, things did
not turn out quite as squeaky clean as hoped for, but still seems
better to do that way.

Closes curl#14798
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants