diff options
author | Clombrong <cromblong@egregore.fun> | 2025-06-17 23:40:39 +0200 |
---|---|---|
committer | Clombrong <cromblong@egregore.fun> | 2025-06-17 23:41:19 +0200 |
commit | 7a1b6a1d14b549de17c4f98b3a4ed80027f1fcac (patch) | |
tree | cf5f2f297715cee08f5fb2e3ab965babdb7c9a2f | |
parent | c91d16adf3253ff1224fb093c7708964e6b2a978 (diff) |
feat(portal-websockets): return a stream of signals with stanza_close
-rw-r--r-- | portal/lib/portal.mli | 2 | ||||
-rw-r--r-- | portal/lib/ws/portal.ml | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/portal/lib/portal.mli b/portal/lib/portal.mli index 7f9dc0d..7b8a30a 100644 --- a/portal/lib/portal.mli +++ b/portal/lib/portal.mli @@ -4,6 +4,6 @@ type t = string Lwt_stream.t * (string option -> unit) val stanza_open : ?from:string -> string -> (signal, sync) stream -val stanza_close : string +val stanza_close : (signal, sync) stream val connect : string -> t Lwt.t diff --git a/portal/lib/ws/portal.ml b/portal/lib/ws/portal.ml index 7b79166..06f952f 100644 --- a/portal/lib/ws/portal.ml +++ b/portal/lib/ws/portal.ml @@ -30,7 +30,7 @@ let stanza_open ?from domain : (signal, sync) stream = `End_element] in stanza |> of_list -let stanza_close = {|<close xmlns="urn:ietf:params:xml:ns:xmpp-framing" />|} +let stanza_close = string {|<close xmlns="urn:ietf:params:xml:ns:xmpp-framing" />|} |> parse_xml |> signals exception MalformedStanza of Markup.location * Markup.Error.t |