curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Forcing curl_multi_perform() to return regularly

From: XSLT2.0 via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 20 Jan 2021 17:02:45 +0100

Indeed, that could the correct solution to "reverse" the control of the
loop and give it back to the application in a "read-like" manner.

You can look at my proposed PR on fcurl that is a "read-like" interface
designed by Daniel some years ago, where the application has control
over when it wants to read.

https://github.com/curl/fcurl/pull/2

Or the fork with the "pause-read-like" algorithm that served to the PR:

https://github.com/Bylon2/fcurl/blob/master/src/fcurl.c

That being said, unfortunately 'pause' has severe limitations on modern
system (not really multi-thread friendly) which should not bother you on
"vintage" systems.

IMHO

- curl_easy_pause feature is excellent since it corresponds to use case
where the application wants "full control of the read loop"

- It is so good that it should be better put forward in the documentation.

- Limitations about not-really multi-thread friendly should be ironed
and lifted (or at least better document in which case/O.S./protocol
"dead-locks" can happen)

Cheers

Alain



Date: Tue, 19 Jan 2021 22:55:10 +0000
> From: Jiahao XU <Jiahao_XU_at_outlook.com>
> To: libcurl development <curl-library_at_cool.haxx.se>
> Subject: Re: Forcing curl_multi_perform() to return regularly
> Message-ID:
> <SYBP282MB0202A691D5CBE453A0AF06FB8AA30_at_SYBP282MB0202.AUSP282.PROD.OUTLOOK.COM>
>
> Content-Type: text/plain; charset="utf-8"
>
> Perhaps you can use curl_easy_pause to pause a connection?
>
> Or you can return a special value CURL_READFUNC_PAUSE or CURL_WRITEFUNC_PAUSE in the callback function to paise the connection.
>
> Get Outlook for iOS<https://aka.ms/o0ukef>
> ________________________________


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