From bdeccfd9fff5317f86d1023099b9d73880c8684b Mon Sep 17 00:00:00 2001 From: Justin Matlock Date: Fri, 6 Mar 2015 02:58:52 -0500 Subject: [PATCH] add longer check for xmpp preamble original wasn't catching the preamble from Adium or Pidgin XMPP clients, because of a newline after the initial line. Grew the length of the check string so it'd see the word 'jabber' faster. --- probe.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/probe.c b/probe.c index cf7711f..8cff937 100644 --- a/probe.c +++ b/probe.c @@ -169,7 +169,10 @@ static int is_tinc_protocol( const char *p, int len, struct proto *proto) * */ static int is_xmpp_protocol( const char *p, int len, struct proto *proto) { - if (len < 6) + /* sometimes the word 'jabber' shows up late in the initial string, + sometimes after a newline. this makes sure we snarf the entire preamble + and detect it. (fixed for adium/pidgin) */ + if (len < 50) return PROBE_AGAIN; return memmem(p, len, "jabber", 6) ? 1 : 0;