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...@outlook.com> > To: libcurl development <curl-library@cool.haxx.se> > Subject: Re: Forcing curl_multi_perform() to return regularly > Message-ID: > > <sybp282mb0202a691d5cbe453a0af06fb8a...@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