curl / Mailing Lists / curl-library / Single Mail

curl-library

Question: Send data with redirection and without SEEK_FUNCTION

From: Felipe Kersting via curl-library <curl-library_at_cool.haxx.se>
Date: Fri, 1 Feb 2019 11:52:27 -0200

 Hello developers,

I have the following problem:

I'm using libcurl to send a large chunk of data to a server, using a URL
that always redirects me to the real endpoint via a reponse with 307 HTTP
status + Location. I have set my CURLOPT_READFUNCTION callback to properly
fetch my data, and when CURLOPT_SEEKFUNCTION is also set, my request works.
The data is sent succesfully.

However, depending on the size of the data, I can't provide the
SEEK_FUNCTION to libcurl, because the data can't fit in the local storage.
So, my idea is to send the data dynamically using the READ_FUNCTION. The
problem is that, when I don't provide the SEEK_FUNCTION, my request fails
with the following error: curl_easy_perform() failed: Send failed since
rewinding of the data stream failed

I think the redirection is also helping to make things worse.

Is there a workaround here? Is it possible to send a large chunk of data
without the SEEK function?

Thank you!
Felipe

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-02-01