Skip to content

Race condition issue for curl_global_init and curl_global_cleanup on multi threads #10

Description

@leventkaragol

When the curl_global_init and curl_global_cleanup methods are called again on each HttpRequest object, if many HttpRequests are used in parallel in a multi-thread structure, it causes a race condition and causes one thread to cleanup before the other one finishes its work, resulting in undefined behavior. To prevent this, the curl_global_init method should be called once for the first HttpRequest and should not be called again. Similarly, the curl_global_cleanup method must be called once when exiting the application.

However, these calls should not be left to the user. It should be automated with static methods and mutex.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions