aboutsummaryrefslogtreecommitdiff
path: root/portal/tcp
diff options
context:
space:
mode:
Diffstat (limited to 'portal/tcp')
-rw-r--r--portal/tcp/portal.ml9
1 files changed, 4 insertions, 5 deletions
diff --git a/portal/tcp/portal.ml b/portal/tcp/portal.ml
index 0532c39..e44732d 100644
--- a/portal/tcp/portal.ml
+++ b/portal/tcp/portal.ml
@@ -4,7 +4,7 @@ open Markup
type t = (signal, async) stream * ((signal, sync) stream option -> unit)
-let xmlns = "jabber:client"
+let xmlns = "http://etherx.jabber.org/streams"
exception MalformedStanza of Markup.location * Markup.Error.t
@@ -13,9 +13,8 @@ let header ?from domain ((stream, push) : t) =
let attributes =
[(("", "to"), domain); (("", "version"), "1.0");
(("http://www.w3.org/XML/1998/namespace", "lang"), "en");
- (("http://www.w3.org/2000/xmlns/", "xmlns"), xmlns);
- (("http://www.w3.org/2000/xmlns/", "stream"),
- "http://etherx.jabber.org/streams")]
+ (("http://www.w3.org/2000/xmlns/", "xmlns"), "jabber:client");
+ (("http://www.w3.org/2000/xmlns/", "stream"), xmlns)]
in [`Xml {version="1.0"; encoding=None; standalone=None};
`Start_element
(("http://etherx.jabber.org/streams", "stream"),
@@ -38,7 +37,7 @@ let header ?from domain ((stream, push) : t) =
let* stream_open = Markup_lwt.next stream in
begin
match stream_open with
- | Some `Start_element (("http://etherx.jabber.org/streams", "stream"), attributes) ->
+ | Some `Start_element ((ns, "stream"), attributes) when ns = xmlns->
List.find_map
(fun ((_, name), value) -> if name = "id" then Some value else None)
attributes