diff options
author | Clombrong <cromblong@egregore.fun> | 2025-06-28 18:29:50 +0200 |
---|---|---|
committer | Clombrong <cromblong@egregore.fun> | 2025-06-28 18:46:58 +0200 |
commit | 96b01e8304d30dd86969be9ad88638576af9db83 (patch) | |
tree | 2cd618978209a5f185cccfa5a476fd49cca8cb1a /portal | |
parent | 9aeae3482c3de81b3bd13ca0e52f344b51fa7799 (diff) |
feat(portal): remove location in MalformedStanza
what were you gonna do with that information anyway?
Diffstat (limited to 'portal')
-rw-r--r-- | portal/portal.mli | 2 | ||||
-rw-r--r-- | portal/tcp/portal.ml | 4 | ||||
-rw-r--r-- | portal/ws/portal.ml | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/portal/portal.mli b/portal/portal.mli index 18a7ccf..fab9197 100644 --- a/portal/portal.mli +++ b/portal/portal.mli @@ -1,6 +1,6 @@ open Markup -exception MalformedStanza of location * Error.t +exception MalformedStanza of Error.t type socket diff --git a/portal/tcp/portal.ml b/portal/tcp/portal.ml index b39c0c0..6b7bff6 100644 --- a/portal/tcp/portal.ml +++ b/portal/tcp/portal.ml @@ -12,7 +12,7 @@ type t = { let xmlns = "http://etherx.jabber.org/streams" -exception MalformedStanza of Markup.location * Markup.Error.t +exception MalformedStanza of Markup.Error.t let header ?from domain ({stream; push; _} : t) = let stanza = @@ -156,7 +156,7 @@ let socket_to_stream (sock : socket) = in let push = function | None -> outbound_push None | Some signals -> Markup.iter (fun f -> outbound_push (Some f)) signals - and report loc err = raise (MalformedStanza (loc, err)) in + and report _ err = raise (MalformedStanza err) in let open Markup_lwt in let stream = raw_stream |> lwt_stream diff --git a/portal/ws/portal.ml b/portal/ws/portal.ml index ad1eb86..d1e87e7 100644 --- a/portal/ws/portal.ml +++ b/portal/ws/portal.ml @@ -15,6 +15,8 @@ type t = { let xmlns = "urn:ietf:params:xml:ns:xmpp-framing" +exception MalformedStanza of Markup.Error.t + (* sic. XEP-0156: "host-meta files MUST be fetched only over HTTPS". I don't make the rules. *) let well_known_of (domain : string) = "https://" ^ domain ^ "/.well-known/host-meta" @@ -53,8 +55,6 @@ let header ?from domain {stream; push; _} = (** [close] is a [<close/>] stanza. *) let close = {|<close xmlns="|} ^ xmlns ^ {|" />|} |> string |> parse_xml |> signals -exception MalformedStanza of Markup.location * Markup.Error.t - (** [ws_endpoint domain] is a promise containing the XMPP websocket endpoint associated with [domain], by using the domain's Web-host Metadata. @@ -131,8 +131,8 @@ let connect domain = let open Markup_lwt in (* When sending a malformed stanza (one that Markup.ml doesn't like), a MalformedStanza exception is raised. *) - let report loc err = - raise (MalformedStanza (loc, err)) + let report _ err = + raise (MalformedStanza err) in (* Consumes a stream of Markup.ml signals into a series of frames sent to the WebSocket. *) |