Bug 1005686 - Long delay when FTP connection is interrupted from CURLOPT_HEADERFUNCTION callback
Long delay when FTP connection is interrupted from CURLOPT_HEADERFUNCTION cal...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: curl (Show other bugs)
18
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Kamil Dudka
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-09 03:38 EDT by Tomas Mlcoch
Modified: 2013-09-22 20:07 EDT (History)
2 users (show)

See Also:
Fixed In Version: curl-7.32.0-2.fc20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-11 22:06:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Reproducer (Use flags "-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -lglib-2.0 -lcurl") (1.35 KB, text/x-c)
2013-09-09 03:38 EDT, Tomas Mlcoch
no flags Details

  None (edit)
Description Tomas Mlcoch 2013-09-09 03:38:48 EDT
Created attachment 795521 [details]
Reproducer (Use flags "-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -lglib-2.0 -lcurl")

Description of problem:

I am using CURLOPT_HEADERFUNCTION for parsing FTP return codes (messages) while downloading via FTP.
I am specially interested in FTP code 213 which returns size of a downloaded file. Sometimes I know expected size and when this size differ from size that server reports (via the 213 code), then I want to interrupt this download.

The download interruption is done by returning a bad return value from the CURLOPT_HEADERFUNCTION callback. But I've met the problem, that after a bad return value is returned, the CURL hangs for about 60sec (just my estimation, I didn't do exact measurement) before it returns from curl_easy_perform().

My expectation is that curl_easy_perform() return immediately after CURLOPT_HEADERFUNCTION returns the bad return value.

Version-Release number of selected component (if applicable):
curl-7.29.0-9.fc19.x86_64
libcurl-devel-7.29.0-9.fc19.x86_64

How reproducible:
Check the attached reproducer

Actual results:
60sec hang after download is interrupted

Expected results:
no hang
Comment 1 Kamil Dudka 2013-09-09 07:33:05 EDT
upstream commit:

https://github.com/bagder/curl/commit/c639d725
Comment 2 Tomas Mlcoch 2013-09-09 07:56:32 EDT
It works! Thank you!
Do you plan to make a build with this patch for F18 and F19 sometimes, or it will be only rawhide stuff?
Comment 3 Kamil Dudka 2013-09-09 08:29:46 EDT
fixed in curl-7.32.0-2.fc21
Comment 4 Kamil Dudka 2013-09-09 08:31:00 EDT
(In reply to Tomas Mlcoch from comment #2)
> Do you plan to make a build with this patch for F18 and F19 sometimes, or it
> will be only rawhide stuff?

Sure, will submit updates for F18+ shortly.
Comment 6 Fedora Update System 2013-09-09 09:11:52 EDT
curl-7.29.0-11.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/curl-7.29.0-11.fc19
Comment 7 Fedora Update System 2013-09-09 09:12:05 EDT
curl-7.27.0-12.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/curl-7.27.0-12.fc18
Comment 8 Fedora Update System 2013-09-09 09:12:15 EDT
curl-7.32.0-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/curl-7.32.0-2.fc20
Comment 9 Fedora Update System 2013-09-09 12:20:57 EDT
Package curl-7.32.0-2.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing curl-7.32.0-2.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-16153/curl-7.32.0-2.fc20
then log in and leave karma (feedback).
Comment 10 Fedora Update System 2013-09-11 22:06:06 EDT
curl-7.29.0-11.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 11 Fedora Update System 2013-09-15 20:29:16 EDT
curl-7.27.0-12.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 12 Fedora Update System 2013-09-22 20:07:22 EDT
curl-7.32.0-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.