Reputation: 695
I have a specific problem which requires me to reuse cURL multi handles. Is there a way to do that? I tried to use
curl_copy_handle()
And it did not work saying
curl_copy_handle(): supplied resource is not a valid cURL handle resource
Which is not totally unexpected. Is there a way to reuse or clone a cURL multi handle?
Edit: Calling
clone
Also does not work
Fatal error: __clone method called on non-object
Upvotes: 0
Views: 753
Reputation: 1852
I don't think this is possible with a single built-in function.
As you creating the original cURL multi handle, right before each curl_multi_add_handle()
call, save a copy of each easy (regular) handle in an array A with curl_copy_handle()
.
Then, when you need to re-use the multi handle:
curl_multi_init()
curl_multi_add_handle()
to add a copy (again, with curl_copy_handle()
) of each easy handle to the new multi handleUpvotes: 1