diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sasl.ml | 2 | ||||
-rw-r--r-- | lib/stream.ml | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/sasl.ml b/lib/sasl.ml index 137d84a..02c9222 100644 --- a/lib/sasl.ml +++ b/lib/sasl.ml @@ -29,7 +29,7 @@ let parse_sasl_error = function type sasl_auth = (string option, sasl_error * (string * string) option) result -let send_auth_stanza (stream, push) localpart pass mechanism = +let send_auth_stanza ({stream; push} : Portal.t) localpart pass mechanism = let gen_auth = function | PLAIN -> Base64.encode_exn ("\x00" ^ localpart ^ "\x00" ^ pass) | Unknown s -> failwith "Unsupported authentication mechanism " ^ s diff --git a/lib/stream.ml b/lib/stream.ml index ff3b939..a4795ef 100644 --- a/lib/stream.ml +++ b/lib/stream.ml @@ -43,7 +43,7 @@ let parse_features (el : Xml.element) : features = Basically, it conforms to {{: https://datatracker.ietf.org/doc/html/rfc6120#section-4.3 }}. *) -let negotiate (domain : string) ((stream, push) : Portal.t) : features Lwt.t = - let* _id = Portal.header domain (stream, push) - in let+ features = Xml.get stream >|= parse_features +let negotiate (domain : string) (portal : Portal.t) : features Lwt.t = + let* _id = Portal.header domain portal + in let+ features = Xml.get portal.stream >|= parse_features in features |