Skip to content

examples: improve global init, error checks and returning errors#19053

Closed
vszakats wants to merge 10 commits into
curl:masterfrom
vszakats:exinit
Closed

examples: improve global init, error checks and returning errors#19053
vszakats wants to merge 10 commits into
curl:masterfrom
vszakats:exinit

Conversation

@vszakats
Copy link
Copy Markdown
Member

@vszakats vszakats commented Oct 13, 2025

  • 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.


w/o sp https://github.com/curl/curl/pull/19053/files?w=1

@vszakats vszakats closed this in 4c7507d Oct 13, 2025
@vszakats vszakats deleted the exinit branch October 13, 2025 21:04
vszakats added a commit to vszakats/curl-www that referenced this pull request Apr 17, 2026
Example code has been updated last year to check for more/most
real-world errors.

Refs:
curl/curl@64ed2ea
curl/curl#19055
curl/curl@4c7507d
curl/curl#19053
vszakats added a commit to curl/curl-www that referenced this pull request Apr 17, 2026
Example code has been updated last year to check for more/most
real-world errors.

Refs:

curl/curl@64ed2ea
curl/curl#19055

curl/curl@4c7507d
curl/curl#19053
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant