aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorClombrong <cromblong@egregore.fun>2025-06-17 17:07:56 +0200
committerClombrong <cromblong@egregore.fun>2025-06-17 17:07:56 +0200
commit824f1c0aa9cc448d054b5b8997036bc3ce78d646 (patch)
tree3e8bbbd07f62ad842cd1242fd0fed393c5234c2c /test
parent1389ea74ad01356d06d7bd18d0a759cb0da8f4f0 (diff)
feat(websockets_hello): close stream after main
Diffstat (limited to 'test')
-rw-r--r--test/js/websockets_hello.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/js/websockets_hello.ml b/test/js/websockets_hello.ml
index d417e62..316ae5e 100644
--- a/test/js/websockets_hello.ml
+++ b/test/js/websockets_hello.ml
@@ -1,4 +1,5 @@
open Lwt.Syntax
+open Lwt.Infix
open Js_of_ocaml
open Flesh
@@ -21,8 +22,7 @@ let main (stream, push) localpart password =
in let+ _auth = Sasl.send_auth_stanza (stream, push)
localpart password
Sasl.PLAIN
- in push None;
- match _auth with
+ in 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!"
@@ -40,5 +40,5 @@ let () =
in
let* stream, push = Stream.start domain
in Lwt.catch
- (fun () -> main (stream, push) localpart password)
+ (fun () -> main (stream, push) localpart password >|= (fun () -> push None))
(fun exn -> push None; Lwt.fail exn)