Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/jabber.c @ 25191:b874034d4df2
propagate from branch 'im.pidgin.pidgin' (head dd9cb9ed28311438c0cc3c2962f1c030fb282df3)
to branch 'im.pidgin.cpw.malu.xmpp.attention' (head 334e92dfc949bbb0dfec42b9a3fcddd84bd57847)
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Thu, 01 Jan 2009 18:15:46 +0000 |
parents | d15b50a4db53 3a4070656d61 |
children | 98681dad9355 |
comparison
equal
deleted
inserted
replaced
25190:302f13678ea3 | 25191:b874034d4df2 |
---|---|
349 | 349 |
350 void jabber_send_raw(JabberStream *js, const char *data, int len) | 350 void jabber_send_raw(JabberStream *js, const char *data, int len) |
351 { | 351 { |
352 | 352 |
353 /* because printing a tab to debug every minute gets old */ | 353 /* because printing a tab to debug every minute gets old */ |
354 if(strcmp(data, "\t")) | 354 if(strcmp(data, "\t")) { |
355 purple_debug(PURPLE_DEBUG_MISC, "jabber", "Sending%s: %s\n", | 355 char *text = NULL, *last_part = NULL, *tag_start = NULL; |
356 js->gsc ? " (ssl)" : "", data); | 356 |
357 /* Because debug logs with plaintext passwords make me sad */ | |
358 if(js->state != JABBER_STREAM_CONNECTED && | |
359 /* Either <auth> or <query><password>... */ | |
360 (((tag_start = strstr(data, "<auth ")) && | |
361 strstr(data, "xmlns='urn:ietf:params:xml:ns:xmpp-sasl'")) || | |
362 ((tag_start = strstr(data, "<query ")) && | |
363 strstr(data, "xmlns='jabber:iq:auth'>") && | |
364 (tag_start = strstr(tag_start, "<password>"))))) { | |
365 char *data_start, *tag_end = strchr(tag_start, '>'); | |
366 text = g_strdup(data); | |
367 | |
368 data_start = text + (tag_end - data) + 1; | |
369 | |
370 last_part = strchr(data_start, '<'); | |
371 *data_start = '\0'; | |
372 } | |
373 | |
374 purple_debug(PURPLE_DEBUG_MISC, "jabber", "Sending%s: %s%s%s\n", | |
375 js->gsc ? " (ssl)" : "", text ? text : data, | |
376 last_part ? "password removed" : "", | |
377 last_part ? last_part : ""); | |
378 | |
379 g_free(text); | |
380 } | |
357 | 381 |
358 /* If we've got a security layer, we need to encode the data, | 382 /* If we've got a security layer, we need to encode the data, |
359 * splitting it on the maximum buffer length negotiated */ | 383 * splitting it on the maximum buffer length negotiated */ |
360 | 384 |
361 purple_signal_emit(my_protocol, "jabber-sending-text", js->gc, &data); | 385 purple_signal_emit(my_protocol, "jabber-sending-text", js->gc, &data); |