cURL / Mailing Lists / curl-library / Single Mail

curl-library

non-blocking read function

From: Dmitriy Sergeyev <dsergeyev_at_issart.com>
Date: Tue, 30 Oct 2007 19:00:49 +0600

Hello, all.

I have required of the following functionality which looks currently
doesn't exists in libcurl.
We can specify read function by setting up CURLOPT_READFUNCTION. And
this function will be called each time when libcurl needs for next
block of data to send. But if such data is not currently available,
the only way is to block read function and wait for data. It is
obvious that this it is very unpractical in case of handling of
several connections within one thread via multi-handle.

Maybe it is good idea, to add non-blocking ability for read function?

I'm not very good in libcurl source code, but looks like there is some
kind of state machine inside it. Therefore, maybe addition of such
functionality shouldn't be so hard? For example, read-function can
return some special code, which disables read calls for a while, until
some enable-read-function will be called for appropriate easy-handle.

Or may be there is some other way already exists to solve this?

--
Best regards,
  Dmitriy Sergeyev
C++ Developer of ISS Art, Ltd., Omsk, Russia.
http://issart.com
Received on 2007-10-30