freecwmp
[Top] [All Lists]

[PATCH] freecwmp: don\'t choke on missing cwmp:ID

To: freecwmp@linux-mips.org
Subject: [PATCH] freecwmp: don\'t choke on missing cwmp:ID
From: Kaspar Schleiser <kaspar@schleiser.de>
Date: Thu, 23 Feb 2012 15:55:11 +0100
Cc: Kaspar Schleiser <kaspar@schleiser.de>
Original-recipient: rfc822;freecwmp@linux-mips.org
Sender: freecwmp-bounce@linux-mips.org
Hey,

some servers don't send cwmp:ID. This patch makes freecwmp skip ID handling if 
necessary.

Kaspar


Signed-off-by: Kaspar Schleiser <kaspar@schleiser.de>
---
 src/xml/xml.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/xml/xml.c b/src/xml/xml.c
index de9003f..53bcc77 100644
--- a/src/xml/xml.c
+++ b/src/xml/xml.c
@@ -471,7 +471,7 @@ xml_handle_message(char *msg_in, char **msg_out)
        busy_node = mxmlFindElement(tree_in, tree_in, c, NULL, NULL, 
MXML_DESCEND);
        free(c); c = NULL;
        if (!busy_node)
-               goto error;
+               goto no_id;
 
        busy_node = mxmlWalkNext(busy_node, tree_in, MXML_DESCEND_FIRST);
        if (!busy_node || !busy_node->value.text.string)
@@ -484,6 +484,8 @@ xml_handle_message(char *msg_in, char **msg_out)
        if (!busy_node)
                goto error;
 
+no_id:
+
 set_parameter:
        /* handle cwmp:SetParameterValues */
        len = snprintf(NULL, 0, "%s:%s", ns.cwmp, "SetParameterValues");
-- 
1.7.9


<Prev in Thread] Current Thread [Next in Thread>