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.

Can I use curl_easy_setopt during curl_easy_perform.

From: Wu Yuanshou via curl-library <curl-library_at_cool.haxx.se>
Date: Mon, 12 Jul 2021 11:49:11 +0800

Hi Everyone from libcurl maillist:


&nbsp; &nbsp; Shall I call curl_easy_setopt() during curl_easy_perform() ? It seems like we should not do this according to the document I can find.Instead , I shall quit from the curl_easy_perform() function , apply the setting via &nbsp;curl_easy_setopt() and call curl_easy_perform() again.In my case the option I wanna set is CURLOPT_MAX_RECV_SPEED_LARGE.
&nbsp; &nbsp;&nbsp;
&nbsp; &nbsp; But I can not find a direct clue for it ,meanwhile , from the curl easy options - Everything curl&nbsp;I find the following description ,&nbsp;
which make&nbsp; me more confuse about
You set options in the easy handle to control how that transfer is going to be done,
or in some cases you can actually set options and modify the transfer's behavior while it is in progress.

&nbsp; &nbsp; Is my approach appropriate or if I am wrong , what shall I do to apply new setting to a running easy handle?






&nbsp; &nbsp; Here is the other document I find useful.


libcurl - curl_easy_setopt()

Options set with this function call are valid for all forthcoming transfers performed using this handle. The options are not in any way reset between transfers, so if you want subsequent transfers with different options, you must change them between the transfers. You can optionally reset all options back to internal default with curl_easy_reset.libcurl - curl_easy_perform()
Just note that you will have to use curl_easy_setopt&nbsp;between the invokes to set options for the following curl_easy_perform





Appreciate for your reply.


Yours Sincerely.

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