Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi-app.c example - missing call + question #8234

Closed
danger89 opened this issue Jan 6, 2022 · 4 comments
Closed

multi-app.c example - missing call + question #8234

danger89 opened this issue Jan 6, 2022 · 4 comments

Comments

@danger89
Copy link

@danger89 danger89 commented Jan 6, 2022

You are missing a curl_multi_remove_handle() call in the multi-app.c example. Right?

You could also clean-up the easy handles inside the curl_multi_info_read() method, correct?

Unrelated question: Sometimes I see the while(..curl_multi_info_read()) inside the main while(still_running). But this multi-app.c example the two while loops are after each other.

What is the best way to execute curl_multi_info_read()? Inside the while loop of the other while (like crawler.c or 10-at-a-time.c examples), or after each other like the multi-app.c example?

Thanks!

Regards,
Melroy van den Berg

@bagder
Copy link
Member

@bagder bagder commented Jan 6, 2022

It does miss them, but that's actually fine and this code doesn't leak any memory. We should probably fix it though and not encourage that style.

They are examples and I think its good that they work differently. They show concepts and that there's not just one way to it in an application. You decide what's best for your application.

@danger89
Copy link
Author

@danger89 danger89 commented Jan 7, 2022

Maybe grep over the examples files. Since I can not promise this is the only example case with the multi API interface.

Ps. Again regarding this curl_multi_info_read() usage, it was and still is unclear to me if there is any difference between doing this check inside the other while loop, or after each other.

@bagder
Copy link
Member

@bagder bagder commented Jan 7, 2022

regarding this curl_multi_info_read() usage, it was and still is unclear to me if there is any difference between doing this check inside the other while loop, or after each other.

What would the difference be? The API works as defined and documented. You can then select how to use those functions. This particular example chose to invoke the functions like this.

@bagder bagder closed this as completed in 6008020 Jan 7, 2022
@danger89
Copy link
Author

@danger89 danger89 commented Jan 10, 2022

What would the difference be? The API works as defined and documented. You can then select how to use those functions. This particular example chose to invoke the functions like this.

Yes indeed, what would be the difference indeed. That was my question. But I think there is no difference, which is the answer I needed. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants