examples: improve global init, error checks and returning errors add curl_global_init() and curl_global_cleanup() where missing. check the result of curl_global_init() where missing. return the last curl error from main(). drop Win32-specific socket initialization in favor of curl_global_init(). rename some outliers to res for curl result code. fix cleanup in some error cases. Inspired by Joshua’s report on examples. Closes #19053
examples: improve global init, error checks and returning errors
curl_global_init()
curl_global_cleanup()
main()
res
Inspired by Joshua’s report on examples.
Closes #19053
curl is a command-line tool for transferring data specified with URL syntax. Learn how to use curl by reading the manpage or everything curl.
Find out how to install curl by reading the INSTALL document.
libcurl is the library curl is using to do its job. It is readily available to be used by your software. Read the libcurl manpage to learn how.
curl is Open Source and is distributed under an MIT-like license.
Contact us on a suitable mailing list or use GitHub issues/ pull requests/ discussions.
All contributors to the project are listed in the THANKS document.
For commercial support, maybe private and dedicated help with your problems or applications using (lib)curl visit the support page.
Visit the curl website for the latest news and downloads.
Download the latest source from the Git server:
git clone https://github.com/curl/curl.git
Report suspected security problems via our HackerOne page and not in public.
Thank you to all our backers Become a backer.
Support this project by becoming a sponsor.
curl是一个利用URL语法在命令行下工作的文件传输工具。
curl is a command-line tool for transferring data specified with URL syntax. Learn how to use curl by reading the manpage or everything curl.
Find out how to install curl by reading the INSTALL document.
libcurl is the library curl is using to do its job. It is readily available to be used by your software. Read the libcurl manpage to learn how.
Open Source
curl is Open Source and is distributed under an MIT-like license.
Contact
Contact us on a suitable mailing list or use GitHub issues/ pull requests/ discussions.
All contributors to the project are listed in the THANKS document.
Commercial support
For commercial support, maybe private and dedicated help with your problems or applications using (lib)curl visit the support page.
Website
Visit the curl website for the latest news and downloads.
Source code
Download the latest source from the Git server:
Security problems
Report suspected security problems via our HackerOne page and not in public.
Backers
Thank you to all our backers
Become a backer.
Sponsors
Support this project by becoming a sponsor.