curl_easy_perform() fails in RHEL 7

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 7
  • libcurl-7.29.0-51.el7

Issue

We have application that uses Easy interface of libcurl.

This application downloads files over http:// and file:// protocols using the same easy handle.

We noticed that on RHEL 7 if call to curl_easy_perform() fails with CURLE_OPERATION_TIMEDOUT error, subsequent call also fails with the same error.

Resolution

Root Cause

CURLOPT_MAX_RECV_SPEED_LARGE is not supported for FILE:// transfers so the transfer is still made as fast as possible. Although after the transfer is completed, libcurl would still run it through the ordinary state machine where it will detect that it ran too fast and sleep until the average speed has gone down to the max speed.

After the upstream fix the code will skip from DO_DONE to DONE immediately if no socket is set to be recv()ed or send()ed to.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments