Skip to content

Commit

Permalink
tls-mirage: provide underlying : flow -> FLOW.flow
Browse files Browse the repository at this point in the history
fixes #425
  • Loading branch information
hannesm committed Jan 4, 2024
1 parent 5e8050c commit 1ad08b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mirage/tls_mirage.ml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ module Make (F : Mirage_flow.S) = struct

type wr_or_msg = [ write_error | `Msg of string ]

let underlying flow = flow.flow

let reneg ?authenticator ?acceptable_cas ?cert ?(drop = true) flow =
match flow.state with
| `Eof -> Lwt.return @@ Error `Closed
Expand Down
3 changes: 3 additions & 0 deletions mirage/tls_mirage.mli
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ module Make (F : Mirage_flow.S) : sig
with type error := error
and type write_error := write_error

(** [underlying t] returns the underlying flow. This is useful to extract
information such as [src] and [dst] of that flow. *)
val underlying : flow -> FLOW.flow

(** [reneg ~authenticator ~acceptable_cas ~cert ~drop t] renegotiates the
session, and blocks until the renegotiation finished. Optionally, a new
Expand Down

0 comments on commit 1ad08b6

Please sign in to comment.