Commit bdeccfd9fff5317f86d1023099b9d73880c8684b
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.Justin Matlock committed on 3/6/2015, 7:58:52 AM
Parent: ce7c5b1ba2808da9786ed7cb01608388af5f758b
Files changed
probe.c | changed |
probe.c | ||
---|---|---|
@@ -168,9 +168,12 @@ | ||
168 | 168 | * clients, just checking first frame containing "jabber" in xml entity) |
169 | 169 | * */ |
170 | 170 | static int is_xmpp_protocol( const char *p, int len, struct proto *proto) |
171 | 171 | { |
172 | - if (len < 6) | |
172 | + /* sometimes the word 'jabber' shows up late in the initial string, | |
173 | + sometimes after a newline. this makes sure we snarf the entire preamble | |
174 | + and detect it. (fixed for adium/pidgin) */ | |
175 | + if (len < 50) | |
173 | 176 | return PROBE_AGAIN; |
174 | 177 | |
175 | 178 | return memmem(p, len, "jabber", 6) ? 1 : 0; |
176 | 179 | } |
Built with git-ssb-web