Fix building on OpenBSD, allow one-way shutdown#63
Merged
Conversation
This was referenced Jun 21, 2020
Author
|
I don't care about the close_notify change so much anymore, but please merge the compatibility changes to support LibreSSL. |
smimram
reviewed
Mar 3, 2021
|
|
||
| (** Close an SSL connection. *) | ||
| (** send close notify to the peer. This is SSL_shutdown(3) *) | ||
| val close_notify : socket -> int |
Member
There was a problem hiding this comment.
The API follows the general convention that the return value is never exposed, because it is quite meaningless in OCaml. A boolean indicating whehter the shutdown is finished or not (and exceptions in other cases) would be better.
| val flush : socket -> unit | ||
|
|
||
| (** Close an SSL connection. *) | ||
| (** send close notify to the peer. This is SSL_shutdown(3) *) |
Member
There was a problem hiding this comment.
Suggested change
| (** send close notify to the peer. This is SSL_shutdown(3) *) | |
| (** Send close notify to the peer. This is SSL_shutdown(3). *) |
422a115 to
9bad44b
Compare
this is needed for sending EOF, aka one-way shutdown.
anmonteiro
reviewed
Jul 24, 2022
|
|
||
| let rec shutdown sock = | ||
| if not (close_notify sock) | ||
| then shutdown sock |
Collaborator
There was a problem hiding this comment.
Should this be close_notify to prevent unbounded recursion?
Suggested change
| then shutdown sock | |
| then close_notify sock |
Merged
anmonteiro
added a commit
to anmonteiro/opam-repository
that referenced
this pull request
Oct 20, 2022
CHANGES: - Add `Ssl.close_notify` to perform a one-way shutdown (savonet/ocaml-ssl#63, savonet/ocaml-ssl#96).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EOFover ssl you need to be able to initiate a one-way shutdownSee also ocsigen/lwt_ssl#2 and mirage/ocaml-conduit#319