Merge pull request #44 from antisocialdalek/antisocialdalek-fix-xmpp

add longer check for xmpp preamble
This commit is contained in:
yrutschle 2015-03-09 21:46:18 +01:00
commit 130348ed48
1 changed files with 4 additions and 1 deletions

View File

@ -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;