From c633d0b1b27b96002c51228e7ade6327d687f4a1 Mon Sep 17 00:00:00 2001 From: Clombrong Date: Sat, 28 Jun 2025 12:53:47 +0200 Subject: feat(stream): pass down auth config to the negotiate function --- lib/stream.ml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/stream.ml b/lib/stream.ml index 2b98192..0b600a7 100644 --- a/lib/stream.ml +++ b/lib/stream.ml @@ -43,7 +43,11 @@ let parse_features (el : Xml.element) : features = Basically, it conforms to {{: https://datatracker.ietf.org/doc/html/rfc6120#section-4.3 }}. *) -let negotiate ?(prefer_starttls = true) (domain : string) (portal : Portal.t) : features Lwt.t = +let negotiate + ?(prefer_starttls = true) + (domain : string) + (portal : Portal.t) + (_auth : Sasl.auth_config) : features Lwt.t = (* Restart a stream: Send the usual business, ask for features. *) let start_stream () : features Lwt.t = let* _id = Portal.header domain portal @@ -60,7 +64,7 @@ let negotiate ?(prefer_starttls = true) (domain : string) (portal : Portal.t) : Once [None] is pushed into the stream, the receiving stream is drained and the socket is closed. *) -let initiate (domain : string) : (Portal.t * features) Lwt.t = +let initiate (domain : string) (auth : Sasl.auth_config) : (Portal.t * features) Lwt.t = let open Portal in let* p = connect domain in let push = function @@ -70,5 +74,5 @@ let initiate (domain : string) : (Portal.t * features) Lwt.t = (* Empty the stream completely, then close the socket. *) Lwt.async (fun () -> let+ () = Markup_lwt.drain p.stream in p.push None) in let portal = {p with push} in - let+ features = negotiate domain portal + let+ features = negotiate domain portal auth in (portal, features) -- cgit v1.2.3