Commit 130348ed483d47cd5216d9c0cf4cdc19e7b1f865
Merge pull request #44 from antisocialdalek/antisocialdalek-fix-xmpp
add longer check for xmpp preambleyrutschle committed on 3/9/2015, 8:46:18 PM
Parent: ce7c5b1ba2808da9786ed7cb01608388af5f758b
Parent: bdeccfd9fff5317f86d1023099b9d73880c8684b
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