diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2022-04-08 22:48:00 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2022-04-08 22:54:11 +0900 |
| commit | ba36a38a6c4be38fe4e09cc95a40b58a48daed79 (patch) | |
| tree | 6110994e4a9f28608da92e41b235990257ba13eb /src/XmlRpcRequestParserController.cc | |
| parent | 37a7419fed8e6035a77c30bef456e36cbfd60245 (diff) | |
Allow empty dist name in bencode which is needed for hybrid torrent
Diffstat (limited to 'src/XmlRpcRequestParserController.cc')
| -rw-r--r-- | src/XmlRpcRequestParserController.cc | 7 |
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 |
