Go to file
Jonathan Wernberg 9bf79d0a5a
Revert "ftp: Expression 'ftpc->wait_data_conn' is always false"
The reverted commit introduced a logic error in code that was
correct.

The client using libcurl would notice the error since FTP file
uploads in active transfer mode would somtimes complete with
success despite no transfer having been performed and the
"uploaded" file thus not being on the remote server afterwards.

The FTP server would notice the error because it receives a
RST on the data connection it has established with the client
before any data was transferred at all.

The logic error happens if the STOR response from the server have
arrived by the time ftp_multi_statemach() in the affected code path
is called, but the incoming data connection have not arrived yet.
In that case, the processing of the STOR response will cause
'ftpc->wait_data_conn' to be set to TRUE, contradicting the comment
in the code. Since 'complete' will also be set, later logic would
believe the transfer was done.

In most cases, the STOR response will not have arrived yet when
the affected code path is executed, or the incoming connection will
also have arrived, and thus the error would not express itself.
But if the speed difference of the device using libcurl and the
FTP server is exactly right, the error may happen as often as in
one out of hundred file transfers.

This reverts commit 49f3117a23.

Bug: https://curl.se/mail/lib-2021-07/0025.html
Closes #7362
2021-07-08 10:18:25 +02:00
.circleci copyright: add boiler-plate headers to CI config files 2021-06-29 17:44:03 +02:00
.github GHA: run all tests for hyper too 2021-06-10 08:42:59 +02:00
.muse CI: Add muse CI config 2020-08-04 09:52:52 +02:00
CMake configure/cmake: remove checks for unused gethostbyaddr and gethostbyaddr_r 2021-06-18 13:52:21 +02:00
docs msnprintf: return number of printed characters excluding null byte 2021-07-08 10:05:39 +02:00
include curl.h: include sys/select.h for NuttX RTOS 2021-06-22 14:35:24 +02:00
lib Revert "ftp: Expression 'ftpc->wait_data_conn' is always false" 2021-07-08 10:18:25 +02:00
m4 configure: inhibit the implicit-fallthrough warning on gcc-12 2021-06-29 11:58:25 +02:00
packages metalink: remove 2021-06-07 08:14:25 +02:00
plan9 copyright: fix year ranges 2020-11-05 08:22:10 +01:00
projects copyright: update copyright year ranges to 2021 2021-03-27 23:00:14 +01:00
scripts zuul: use the new rustls directory name 2021-06-30 08:19:31 +02:00
src glob: pass an 'int' as len when using printf's %*s 2021-06-30 14:05:56 +02:00
tests msnprintf: return number of printed characters excluding null byte 2021-07-08 10:05:39 +02:00
winbuild winbuild/README: VC should be set to 6 'or larger' 2021-06-14 16:26:25 +02:00
zuul.d zuul: use the new rustls directory name 2021-06-30 08:19:31 +02:00
.azure-pipelines.yml CI/azure: increase verbosity and fix outdated task names 2021-05-16 11:23:59 +02:00
.cirrus.yml metalink: remove 2021-06-07 08:14:25 +02:00
.dcignore .dcignore: ignore tests and docs directories 2020-06-27 00:07:37 +02:00
.dir-locals.el curl.se: new home 2020-11-04 23:59:47 +01:00
.gitattributes gitattributes: Set batch files to CRLF line endings on checkout 2021-01-14 15:59:56 -05:00
.gitignore .gitignore: add directory containing the stats repo 2020-06-05 19:54:34 +02:00
.lgtm.yml metalink: remove 2021-06-07 08:14:25 +02:00
.mailmap mailmap: Jon Rumsey 2021-02-05 08:46:11 +01:00
acinclude.m4 configure: include <time.h> unconditionally 2021-04-07 16:08:01 +02:00
appveyor.yml ci: adapt to configure requiring an explicit TLS choice 2021-04-22 23:19:47 +02:00
buildconf buildconf: exec autoreconf to avoid additional process 2020-08-29 21:43:49 +02:00
buildconf.bat curl.se: new home 2020-11-04 23:59:47 +01:00
CHANGES curl.se: new home 2020-11-04 23:59:47 +01:00
CMakeLists.txt cmake: remove libssh2 feature checks 2021-07-05 22:44:00 +02:00
configure.ac configure/cmake: remove checks for unused gethostbyaddr and gethostbyaddr_r 2021-06-18 13:52:21 +02:00
COPYING COPYING/configure: bump copyright year range 2021-01-01 00:52:28 +01:00
curl-config.in curl.se: new home 2020-11-04 23:59:47 +01:00
GIT-INFO GIT-INFO: suggest using autoreconf instead of buildconf 2021-05-08 10:55:34 +02:00
libcurl.pc.in Revert "libcurl.pc: make it relocatable" 2020-11-09 09:13:06 +01:00
MacOSX-Framework curl.se: new home 2020-11-04 23:59:47 +01:00
Makefile.am Revert "libcurl.pc: make it relocatable" 2020-11-09 09:13:06 +01:00
Makefile.dist configure: provide --with-openssl, deprecate --with-ssl 2021-04-15 09:08:34 +02:00
maketgz copyright: fix year ranges 2020-11-05 08:22:10 +01:00
README curl.se: new home 2020-11-04 23:59:47 +01:00
README.md CI: remove travis details 2021-06-29 17:42:57 +02:00
RELEASE-NOTES RELEASE-NOTES: synced 2021-07-05 22:55:14 +02:00
SECURITY.md

curl logo

CII Best Practices Coverity passed AppVeyor Build Status Azure DevOps Build Status Cirrus Build Status Backers on Open Collective Sponsors on Open Collective Language Grade: C/C++ Codacy Badge Fuzzing Status

Curl is a command-line tool for transferring data specified with URL syntax. Find out how to use curl by reading the curl.1 man page or the MANUAL document. 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.3 man page to learn how!

You can find answers to the most frequent questions we get in the FAQ document.

Study the COPYING file for distribution terms.

Contact

If you have problems, questions, ideas or suggestions, please contact us by posting to a suitable mailing list.

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: https://curl.se/support.html

Website

Visit the curl website for the latest news and downloads.

Git

To download the very latest source from the Git server do this:

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

(you'll get a directory named curl created, filled with the source code)

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. Your logo will show up here with a link to your website. [Become a sponsor]