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

fix: fix s2n_io_pair_close_one_end #4841

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

boquan-fang
Copy link
Contributor

Resolved issues:

Partially Solve #4005.

Our current implementation for s2n_io_pair_close_one_end has problems:

  • It might attempt to close a already closed fd, and failed the s2n_io_pair_close function.
  • It might accidentally close a valid fd, that is reused by one closed end of io_pair.

Description of changes:

  • Add checking logics for s2n_io_pair_close_one_end().
    • Only proceed to close a fd if the fd is not previously closed.
    • Define S2N_CLOSED_FD to be -1.
    • Set closed fd to S2N_CLOSED_FD.

Call-outs:

Testing:

  • It passes all unit tests.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

* add checking logics for s2n_io_pair_close_one_end()
@boquan-fang boquan-fang enabled auto-merge (squash) October 15, 2024 17:52
@boquan-fang boquan-fang merged commit 66e90d7 into aws:main Oct 15, 2024
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants