ftp: move listen handling to socket filter

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 #14798
3 files changed
tree: b0d565c10762ce6bdcb63cbbf036e96c7d203e77
  1. .circleci/
  2. .github/
  3. CMake/
  4. docs/
  5. include/
  6. lib/
  7. LICENSES/
  8. m4/
  9. packages/
  10. plan9/
  11. projects/
  12. scripts/
  13. src/
  14. tests/
  15. winbuild/
  16. .dir-locals.el
  17. .git-blame-ignore-revs
  18. .gitattributes
  19. .gitignore
  20. .mailmap
  21. acinclude.m4
  22. appveyor.sh
  23. appveyor.yml
  24. buildconf
  25. buildconf.bat
  26. CHANGES.md
  27. CMakeLists.txt
  28. configure.ac
  29. COPYING
  30. curl-config.in
  31. Dockerfile
  32. GIT-INFO.md
  33. libcurl.pc.in
  34. Makefile.am
  35. Makefile.dist
  36. README
  37. README.md
  38. RELEASE-NOTES
  39. renovate.json
  40. REUSE.toml
  41. SECURITY.md
README.md

curl logo

Curl is a command-line tool for transferring data specified with URL syntax. Learn how to use curl by reading the manpage or everything curl.

Find out how to install curl by reading the INSTALL document.

libcurl is the library curl is using to do its job. It is readily available to be used by your software. Read the libcurl manpage to learn how.

Open Source

curl is Open Source and is distributed under an MIT-like license.

Contact

Contact us on a suitable mailing list or use GitHub issues/ pull requests/ discussions.

All contributors to the project are listed in the THANKS document.

Commercial support

For commercial support, maybe private and dedicated help with your problems or applications using (lib)curl visit the support page.

Website

Visit the curl website for the latest news and downloads.

Source code

Download the latest source from the Git server:

git clone https://github.com/curl/curl.git

Security problems

Report suspected security problems via our HackerOne page and not in public.

Notice

Curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan. This notice is included here to comply with the distribution terms.

Backers

Thank you to all our backers! 🙏 Become a backer.

Sponsors

Support this project by becoming a sponsor.