summaryrefslogtreecommitdiff
path: root/indra/llxml/llxmlnode.h
diff options
context:
space:
mode:
authorHenri Beauchamp <sldev@free.fr>2024-07-08 23:18:02 +0200
committerHenri Beauchamp <sldev@free.fr>2024-07-08 23:18:02 +0200
commit989cfe2f70441fe02222d369e84118a94dc96890 (patch)
tree50f52d9c4b956ce41fe3d4e5df135aab78fdbfb1 /indra/llxml/llxmlnode.h
parent94a66b558401c77953c990a992a91c7b32493f82 (diff)
Fix for crash in XMLRPC reply decoding on login with large inventories
Commit 2ea5ac0c43e3e28d2b1774f5367d099271a1da32 introduced a crash bug due to the recursive construction of the XMLTreeNode wrapper class. The constructor of the said class typically recurses twice as many times as there are entries in the user's inventory list. This commit: - Moves the fromXMLRPCValue() method and its helper functions from the LLSD class/module to the LLXMLNode class, where it belongs, thus making LLSD::TreeNode (which was a wrapper class to avoid making llcommon dependant on llxml, which is still the case after this commit) totally moot; the fromXMLRPCValue() call is now done directly on the LLXMLNode. - Moves the XML and XMLRPC decoding code out of the HTTP coroutine LLXMLRPCTransaction::Handler (coroutines got an even smaller and fixed stack), and into LLXMLRPCTransaction::Impl::process(). - Removes XMLTreeNode entirely, fixing the crash as a result.
Diffstat (limited to 'indra/llxml/llxmlnode.h')
-rw-r--r--indra/llxml/llxmlnode.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/llxml/llxmlnode.h b/indra/llxml/llxmlnode.h
index b8f9e1ff69..3769ec8293 100644
--- a/indra/llxml/llxmlnode.h
+++ b/indra/llxml/llxmlnode.h
@@ -50,6 +50,7 @@ class LLVector3d;
class LLQuaternion;
class LLColor4;
class LLColor4U;
+class LLSD;
struct CompareAttributes
@@ -284,12 +285,18 @@ public:
void setAttributes(ValueType type, U32 precision, Encoding encoding, U32 length);
// void appendValue(const std::string& value); // Unused
+ bool fromXMLRPCValue(LLSD& target);
+
// Unit Testing
void createUnitTest(S32 max_num_children);
bool performUnitTest(std::string &error_buffer);
protected:
bool removeChild(LLXMLNode* child);
+ bool isFullyDefault();
+
+ bool parseXmlRpcArrayValue(LLSD& target);
+ bool parseXmlRpcStructValue(LLSD& target);
public:
std::string mID; // The ID attribute of this node
@@ -328,8 +335,6 @@ protected:
static const char *skipNonWhitespace(const char *str);
static const char *parseInteger(const char *str, U64 *dest, bool *is_negative, U32 precision, Encoding encoding);
static const char *parseFloat(const char *str, F64 *dest, U32 precision, Encoding encoding);
-
- bool isFullyDefault();
};
#endif // LL_LLXMLNODE