summaryrefslogtreecommitdiff
path: root/src/XmlRpcRequestParserController.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2022-04-08 22:48:00 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2022-04-08 22:54:11 +0900
commitba36a38a6c4be38fe4e09cc95a40b58a48daed79 (patch)
tree6110994e4a9f28608da92e41b235990257ba13eb /src/XmlRpcRequestParserController.cc
parent37a7419fed8e6035a77c30bef456e36cbfd60245 (diff)
Allow empty dist name in bencode which is needed for hybrid torrent
Diffstat (limited to 'src/XmlRpcRequestParserController.cc')
-rw-r--r--src/XmlRpcRequestParserController.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/XmlRpcRequestParserController.cc b/src/XmlRpcRequestParserController.cc
index 25a5addc..a3c9a857 100644
--- a/src/XmlRpcRequestParserController.cc
+++ b/src/XmlRpcRequestParserController.cc
@@ -54,7 +54,7 @@ void XmlRpcRequestParserController::popStructFrame()
Dict* dict = downcast<Dict>(parentFrame.value_);
assert(dict);
frameStack_.pop();
- if (currentFrame_.validMember()) {
+ if (currentFrame_.validMember(allowEmptyMemberName_)) {
dict->put(std::move(currentFrame_.name_), std::move(currentFrame_.value_));
}
currentFrame_ = std::move(parentFrame);
@@ -110,6 +110,11 @@ void XmlRpcRequestParserController::setMethodName(std::string methodName)
methodName_ = std::move(methodName);
}
+void XmlRpcRequestParserController::setAllowEmptyMemberName(bool b)
+{
+ allowEmptyMemberName_ = b;
+}
+
} // namespace rpc
} // namespace aria2