I'm planning a talk (video) on this topic and here I'm collecting the most common mistakes we've seen reported, discussed and revealed in recent years. What other mistakes do you see happen repeatedly?
- Skipping the documentation!
- Failure to check return codes
- Forgetting the verbose option
- There's a global init function
-
- that isn't thread-safe
- Let users set (parts of) the URL
- Consider the redirects
- Unnecessary setting HTTP method
- Disabled certificate checks
- Assume zero terminated data in callbacks
- C++ strings are not C strings
- Threading mistakes
- Understanding CURLOPT_NOSIGNAL
- Forgetting -DCURL_STATICLIB
Forgetting a
-DCURL_STATICLIB
is pretty common (when using a static libcurl).