summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorClombrong <cromblong@egregore.fun>2025-06-29 05:37:20 +0200
committerClombrong <cromblong@egregore.fun>2025-06-29 05:38:34 +0200
commit1fa0e770fe4d6108fe85ca7b49fd0e0b1e545215 (patch)
tree319a28d28c296e0e6475ac434405feb6fc7c5495 /lib
parent3bc4f79c124f3fbafe6cd00dc5f446f38e29320b (diff)
feat(portal_tcp): send closing element when pushing None
Diffstat (limited to 'lib')
-rw-r--r--lib/stream.ml12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/stream.ml b/lib/stream.ml
index e6a46b8..b997a25 100644
--- a/lib/stream.ml
+++ b/lib/stream.ml
@@ -79,12 +79,6 @@ let negotiate
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
- | Some n -> p.push (Some n)
- | None ->
- p.push (Some close);
- (* 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 auth
- in (portal, features)
+ in let+ features = negotiate domain p auth
+ in (p, features)
+