curl-curl/tests/data/test753
Stefan Eissing 66d35ee5d4 lib: avoid reusing unclean connection
When `curl_easy_cleanup()` is invoked while still being part
of a multi handle, the code will auto-remove it. But since the
connection was detached first, the code in
`curl_multi_remove_handle()` that invalidates dirty connections
did not bite.

Attach the connection *after* the possible remove from a multi
handle, so that connection reuse can be prevented.

Add test753 to reproduce and verify the fix. This required adding
the new debug env var CURL_FTP_PWD_STOP, to have a transfer return
from multi_perform() early with a connection that does not show
and pending input.

Reported-by: Brian Harris

Fixes https://github.com/curl/curl/issues/17578
Closes https://github.com/curl/curl/pull/17607
2025-06-15 03:22:25 -04:00

46 lines
535 B
Plaintext

<testcase>
<info>
<keywords>
FTP
</keywords>
</info>
# Client-side
<client>
<features>
Debug
ftp
</features>
<server>
ftp
</server>
<tool>
lib%TESTNUMBER
</tool>
<name>
cleanup easy without multi_remove_handle
</name>
<command>
ftp://%HOSTIP:%FTPPORT/%TESTNUMBER
</command>
<setenv>
CURL_FTP_PWD_STOP=1
</setenv>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol>
USER anonymous
PASS ftp@example.com
USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE I
SIZE 753
QUIT
</protocol>
</verify>
</testcase>