Accept XML text declaration for Jabber initiating data
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Fri, 22 Sep 2006 21:12:55 +0000 (21:12 +0000)
committerThadeu Lima de Souza Cascardo <cascardo@minaslivre.org>
Fri, 22 Sep 2006 21:12:55 +0000 (21:12 +0000)
For the purpose of protocol detection, accepts XML text declaration as
indication of the Jabber protocol. Gaim, for example, uses that, and
XMPP Core recommends its use (SHOULD).

proto_detect.c

index 57bd01a..112ff93 100644 (file)
@@ -42,7 +42,8 @@ static void proto_read (net_hook_t* hook, gchar* buffer, size_t len)
   g_string_append_len (str, buffer, len);
   if (str->len >= 7)
     {
-      if (!strncmp (str->str, "<stream", 7))
+      if (!strncmp (str->str, "<stream", 7) ||
+         !strncmp (str->str, "<?xml ", 6))
        {
          /* Connection is a Jabber client */
          g_debug ("Connection from %s is a Jabber client.",