aboutsummaryrefslogtreecommitdiffstats
path: root/testing/loudmouth/03-drop-stanzas-on-fail.patch
diff options
context:
space:
mode:
authorFabian Affolter <fabian@affolter-engineering.ch>2012-01-03 05:06:35 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-01-16 15:41:16 +0000
commitb91d477a12229fcbf1bb723745d8e0b9386d3148 (patch)
tree95070dd18aac1a3e92a5f87463d985e5d4182a25 /testing/loudmouth/03-drop-stanzas-on-fail.patch
parent040d8932239b6e90967869178b344f7e12d2aaab (diff)
downloadaports-b91d477a12229fcbf1bb723745d8e0b9386d3148.tar.gz
aports-b91d477a12229fcbf1bb723745d8e0b9386d3148.tar.bz2
aports-b91d477a12229fcbf1bb723745d8e0b9386d3148.tar.xz
Patch files for loudmouth
Diffstat (limited to 'testing/loudmouth/03-drop-stanzas-on-fail.patch')
-rw-r--r--testing/loudmouth/03-drop-stanzas-on-fail.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/testing/loudmouth/03-drop-stanzas-on-fail.patch b/testing/loudmouth/03-drop-stanzas-on-fail.patch
new file mode 100644
index 0000000000..05f4248de0
--- /dev/null
+++ b/testing/loudmouth/03-drop-stanzas-on-fail.patch
@@ -0,0 +1,46 @@
+From: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+Date: Tue, 13 Jan 2009 11:28:44 +0000
+Subject: [PATCH] Drop stanzas when failing to convert them to LmMessages
+
+when a stanza comes in that for some reason can't be parsed into an LmMessage,
+just drop them on the floor instead of blocking the parser. I've seen this
+issue happen in practise because some (buggy?) client sending an iq with a
+prefix e.g. <client:iq xmlns:client="jabber:client" ... />
+---
+ loudmouth/lm-parser.c | 15 ++++++---------
+ 1 files changed, 6 insertions(+), 9 deletions(-)
+
+diff --git a/loudmouth/lm-parser.c b/loudmouth/lm-parser.c
+index 1938d56..89f6675 100644
+--- a/loudmouth/lm-parser.c
++++ b/loudmouth/lm-parser.c
+@@ -151,19 +151,16 @@ parser_end_node_cb (GMarkupParseContext *context,
+ if (!m) {
+ g_warning ("Couldn't create message: %s\n",
+ parser->cur_root->name);
+- return;
+- }
+-
+- g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_PARSER,
++ } else {
++ g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_PARSER,
+ "Have a new message\n");
+- if (parser->function) {
+- (* parser->function) (parser, m, parser->user_data);
++ if (parser->function) {
++ (* parser->function) (parser, m, parser->user_data);
++ }
++ lm_message_unref (m);
+ }
+
+- lm_message_unref (m);
+ lm_message_node_unref (parser->cur_root);
+-
+-
+ parser->cur_node = parser->cur_root = NULL;
+ } else {
+ LmMessageNode *tmp_node;
+--
+1.5.6.5
+
+