]> git.ipfire.org Git - thirdparty/curl.git/commit
easy: allow connect-only handle reuse with easy_perform
authorJay Satiro <raysatiro@yahoo.com>
Wed, 15 Jan 2025 08:56:11 +0000 (03:56 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 28 Jan 2025 08:27:04 +0000 (03:27 -0500)
commit4f99efb192590ec7263d1f88de99a03dbe469970
tree1847020772b027aae4c5ccf345edb22aee4e8c38
parentf25a807a7d5d96053c7990fc7178f6a133ecb7e9
easy: allow connect-only handle reuse with easy_perform

- Detach and disconnect an attached connection before performing.

Prior to this change it was not possible to safely reuse an easy handle
with an attached connection in a second call to curl_easy_perform. The
only known case of this is a connect-only type handle where the
connection was detached when curl_easy_perform returned, only to be
reattached by either curl_easy_send/recv.

This commit effectively reverts 2f8ecd5d and be82a360, the latter of
which treated the reuse as an error. Prior to that change undefined
behavior may occur in such a case.

Bug: https://curl.se/mail/lib-2025-01/0044.html
Reported-by: Aleksander Mazur
Closes https://github.com/curl/curl/pull/16008
docs/libcurl/opts/CURLOPT_CONNECT_ONLY.md
lib/easy.c
tests/data/test696
tests/libtest/lib556.c