diff options
author | Clombrong <cromblong@egregore.fun> | 2025-06-26 16:41:40 +0200 |
---|---|---|
committer | Clombrong <cromblong@egregore.fun> | 2025-06-26 21:40:53 +0200 |
commit | 3dd884417ad78993bf6f3dc59349f20bd3fddfa0 (patch) | |
tree | dc45971b5ea6c620cb03c554c310531b2ec9eac1 /test | |
parent | 763187955aed2c6ff07eee5f31d413bef81075df (diff) |
fix(stream): remove start function
Diffstat (limited to 'test')
-rw-r--r-- | test/hello.ml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/hello.ml b/test/hello.ml index b397727..a00eb2e 100644 --- a/test/hello.ml +++ b/test/hello.ml @@ -4,11 +4,13 @@ open! Flesh let program (stream, push) config = let+ _auth = Sasl.authenticate (stream, push) config - in match _auth with + in begin match _auth with | Error (NotAuthorized, Some (_, text)) -> print_endline ("Not authorized: " ^ text) | Error (MalformedRequest, Some (_, text)) -> print_endline ("Malformed request: " ^ text) | Error _ -> print_endline "Error!" | Ok _ -> print_endline "Success!" + end; + Portal.close (stream, push) let main = let config : Sasl.auth_config = { @@ -17,7 +19,8 @@ let main = preferred_mechanisms = [Stream.PLAIN] } in let domain = (List.nth (String.split_on_char '@' config.jid) 1) in - let* stream, push = Stream.start domain in + let* stream, push = Portal.connect domain in + let* _id = Portal.header domain (stream, push) in Lwt.catch (fun () -> program (stream, push) config >|= (fun () -> push None)) (fun exn -> |