diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/stream.ml | 10 |
1 files changed, 7 insertions, 3 deletions
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) |