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.h | |
| parent | 37a7419fed8e6035a77c30bef456e36cbfd60245 (diff) | |
Allow empty dist name in bencode which is needed for hybrid torrent
Diffstat (limited to 'src/XmlRpcRequestParserController.h')
| -rw-r--r-- | src/XmlRpcRequestParserController.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/XmlRpcRequestParserController.h b/src/XmlRpcRequestParserController.h index 7892147b..b84a7de1 100644 --- a/src/XmlRpcRequestParserController.h +++ b/src/XmlRpcRequestParserController.h @@ -52,7 +52,10 @@ private: std::unique_ptr<ValueBase> value_; std::string name_; - bool validMember() const { return value_ && !name_.empty(); } + bool validMember(bool allowEmptyMemberName) const + { + return value_ && (allowEmptyMemberName || !name_.empty()); + } void reset() { @@ -67,7 +70,11 @@ private: std::string methodName_; + bool allowEmptyMemberName_; + public: + XmlRpcRequestParserController() : allowEmptyMemberName_(false) {} + void pushFrame(); // Pops StateFrame p from frameStack_ and set p[currentFrame_.name_] @@ -90,6 +97,8 @@ public: const std::string& getMethodName() const { return methodName_; } + void setAllowEmptyMemberName(bool b); + void reset(); }; |
