Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

jay
Copy link
Member

@jay jay commented May 10, 2024

  • 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
Copy link
Member

@bagder bagder left a comment

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.

None yet

2 participants