diff options
-rw-r--r-- | portal/lib/portal_ws.ml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/portal/lib/portal_ws.ml b/portal/lib/portal_ws.ml index 69e415e..ecbbe60 100644 --- a/portal/lib/portal_ws.ml +++ b/portal/lib/portal_ws.ml @@ -104,7 +104,10 @@ let connect domain = in (* Consumes a stream of stanzas fragments into a series of frames sent to the WebSocket. *) (* Right now... This doesn't do much. *) - let to_frames stream = - let+ _ = Lwt_stream.iter (fun x -> ws_push (Some x)) stream in ws_push None + let to_frames fragments = + let stanzas = + let open Markup_lwt in + lwt_stream fragments |> to_lwt_stream + in let+ _ = Lwt_stream.iter (fun x -> ws_push (Some x)) stanzas in ws_push None in Lwt.async @@ (fun () -> to_frames streamed_stanzas); stream, push |