Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Adds rewind function to allow curl seek and retry sending data to server #1529

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jbfitb
Copy link

@jbfitb jbfitb commented Oct 18, 2019

Issue

  • Implement CURLOPT_SEEKFUNCTION #1526
  • About 1 in 10 Alexa requests fail on mobile devices.
  • Requests generally fail with one of two errors: curl error code 56 which is "receive error" or curl error code 65 which is "rewind failed"
  • I turned on ACSDK_EMIT_SENSITIVE_LOGS to output curl error messages and me help investigate what was going on
  • It looks like the errors (both 56 and 65) are accompanied with this message "necessary data rewind wasn't possible":
CurlEasyHandleWrapper:libcurl:id=AVSEvent-619,text=necessary data rewind wasn't possible
LibcurlHTTP2Request:getResponseCode:responseCode=0
LibcurlHTTP2Connection:streamFinished:streamId=AVSEvent-619,result=Error,CURLcode=56

Description of changes:

  1. Implemented callback functions for CURLOPT_SEEKFUNCTION
  2. Add a rewind function to the read callbacks
  3. Call seek on AttachmentReader when called from curl

Testing:

Was able to build and run automated tests. This seems to fix the issue. No more 56 or 65 errors.

@kclchan
Copy link
Contributor

kclchan commented Oct 18, 2019

Hi @jbfitb,

Thank you for the pull request. Our process is to make changes internally and run all test before pushing the change to github in the form of a new release. I have added this to our internal tracking system to be assessed and prioritized.

Thanks,
Kenneth

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants