improve the parsing of form data

This commit is contained in:
Chunting Gu
2020-12-07 14:16:08 +08:00
parent 63abc5bbda
commit abd30ab69d
6 changed files with 45 additions and 31 deletions
+2 -3
View File
@@ -26,8 +26,6 @@ private:
// asks for data streaming.
bool OnHeadersEnd() override;
bool Stream() const;
bool ParseStartLine(const std::string& line) override;
// Override to handle multipart form data which is request only.
@@ -51,13 +49,14 @@ private:
// received. The parsing will stop and fail if no view can be matched.
ViewMatcher view_matcher_;
// Form data parsing step.
// Form data parsing steps.
enum Step {
kStart,
kBoundaryParsed,
kHeadersParsed,
kEnded,
};
Step step_ = kStart;
// The current form part being parsed.