Skip to content

lib: clear the easy handle's saved errno before transfer - #13574

Closed
jay wants to merge 1 commit into
curl:masterfrom
jay:improve_os_errno
Closed

lib: clear the easy handle's saved errno before transfer#13574
jay wants to merge 1 commit into
curl:masterfrom
jay:improve_os_errno

Conversation

@jay

@jay jay commented May 10, 2024

Copy link
Copy Markdown
Member
  • Clear data->state.os_errno before transfer.

  • Explain the change in behavior in the CURLINFO_OS_ERRNO doc.

  • Add to the CURLINFO_OS_ERRNO doc the list of libcurl network-related errors that may cause the errno to be saved.

data->state.os_errno is saved before libcurl returns a network-related failure such as connection failure. It is accessible to the user via CURLINFO_OS_ERRNO so they can get more information about the failure.

Prior to this change it wasn't cleared before transfer so if a user retrieved the saved errno it could be from a previous transfer. That is because an errno is not always saved for network-related errors.

Closes #xxxxx

- Clear data->state.os_errno before transfer.

- Explain the change in behavior in the CURLINFO_OS_ERRNO doc.

- Add to the CURLINFO_OS_ERRNO doc the list of libcurl network-related
  errors that may cause the errno to be saved.

data->state.os_errno is saved before libcurl returns a network-related
failure such as connection failure. It is accessible to the user via
CURLINFO_OS_ERRNO so they can get more information about the failure.

Prior to this change it wasn't cleared before transfer so if a user
retrieved the saved errno it could be from a previous transfer. That is
because an errno is not always saved for network-related errors.

Closes #xxxxx

@bagder bagder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@jay jay closed this in 798a37b May 10, 2024
@jay
jay deleted the improve_os_errno branch May 10, 2024 22:31
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.

2 participants