cURL / Mailing Lists / curl-library / Single Mail

curl-library

curl_easy_pause documentation question

From: Ben Combee <ben.combee_at_gmail.com>
Date: Wed, 9 Apr 2008 16:02:34 -0500

I'm thinking of using curl_easy_pause in some code I'm writing that
needs to stream media over HTTP, which means that sometimes, the
decoder can't buffer more and we need to keep libcurl from delivering
more data.

Am I correct in assuming that the PAUSE return values are only valid
for easy handles that are attached to a multi handle? It seems like
if you'd called curl_easy_perform, there would be no way to unpause
the handle. I think the behavior here should be documented.

Another documentation issue: if a write callback returns
CURL_WRITEFUNC_PAUSE, what is the disposition of the data provided to
the callback? Will it get sent again in the future when the stream is
unpaused, or does libcurl expect that data to be consumed?

My code is already working to a limited degree by doing a "pause
everything" by withholding calls to curl_multi_perform. One thing I
observed with the older versions was that libcurl would stop a
transfer with an error if a write callback didn't absorb all of the
data given to it. Now that we have the ability to pause, it would be
nice to also allow partial writes, with the leftover data stored in
libcurl until the next write callback For example, curl provides me
with 4K of data, I absorb 2K of this data filling my own buffer, then
call curl_easy_pause on the stream from the write callback and return
2K from the write call.

Thanks for the great work!
Received on 2008-04-09