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

Update to Eio 0.12 #479

Merged
merged 3 commits into from
Sep 24, 2023
Merged

Update to Eio 0.12 #479

merged 3 commits into from
Sep 24, 2023

Conversation

talex5
Copy link
Contributor

@talex5 talex5 commented Sep 19, 2023

(note: this looks long, but most of the changes are to the fuzz tests)

The changes to tls-eio.ml are:

  • Add new Tls_socket_closed error. Writing to a closed connection previously reported end-of-file, which isn't quite right.
  • Replace the object types with non-object types.
  • Rename read to single_read, write to single_write, and copy_from to copy, to match the Eio 0.12 API.
  • copy now uses an Eio helper that just calls single_write.

This removes all uses of objects from tls-eio.ml.

Previously, writing to a closed connection raised `End_of_file`, but
that is misleading (it's normally used when reading from an input
stream, not when writing). This error normally occurs when the other end
shut down one side of the connection (which currently causes both
directions to be shut down).

`tls_lwt` raises `Invalid_argument` in this case, but it seems more
useful to group this with other errors where the remote end closes the
connection, so I used Eio's `Connection_reset` error here.

This was previously confusing the `copy` operation, which assumed there
was no more data to copy rather than that the write had failed, and so
didn't report an error at all in this case.

I also enabled logging in the fuzz tests by default (at warning level).
As well as ensuring that warnings are displayed, this also makes it
easy to switch to debug logging when needed.
Fixes some linter warnings in CI.
@hannesm hannesm merged commit cf038c9 into mirleft:main Sep 24, 2023
1 check passed
hannesm added a commit to hannesm/opam-repository that referenced this pull request Sep 24, 2023
hannesm added a commit to hannesm/opam-repository that referenced this pull request Sep 24, 2023
CHANGES:

* tls-eio: update to eio 0.12 (mirleft/ocaml-tls#479 @talex5)
@hannesm
Copy link
Member

hannesm commented Sep 24, 2023

Thanks for your PR.

I cut a release of tls-eio at ocaml/opam-repository#24515 (since I suspect you'd like to use this rather sooner than later). Since the rest of tls* is not affected, I did not add these packages to the release (this should safe quite some CPU cycles for people not using tls-eio).

Enjoy the release.

@talex5 talex5 deleted the eio branch September 25, 2023 11:56
@talex5
Copy link
Contributor Author

talex5 commented Sep 25, 2023

That's great - thanks!

nberth pushed a commit to nberth/opam-repository that referenced this pull request Jun 18, 2024
CHANGES:

* tls-eio: update to eio 0.12 (mirleft/ocaml-tls#479 @talex5)
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants