1
0
mirror of https://github.com/moparisthebest/sslh synced 2024-11-21 08:35:01 -05:00

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 <xml> line. Grew the length of the check string so it'd see the word 'jabber' faster.
This commit is contained in:
Justin Matlock 2015-03-06 02:58:52 -05:00
parent ce7c5b1ba2
commit bdeccfd9ff

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;