diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-05 22:45:45 +0100 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-05 22:50:18 +0100 |
commit | ca6ef58b1ee8521e4b940ee4883dee714960e413 (patch) | |
tree | 8532add455224b07c07a759e3d906f50c0695888 /src/HTTPServer/MultipartParser.h | |
parent | Merge pull request #2972 from marvinkopf/PlayerAutoComplete (diff) | |
download | cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.gz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.bz2 cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.lz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.xz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.zst cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.zip |
Diffstat (limited to 'src/HTTPServer/MultipartParser.h')
-rw-r--r-- | src/HTTPServer/MultipartParser.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/HTTPServer/MultipartParser.h b/src/HTTPServer/MultipartParser.h index ad76ad650..4f20b2bed 100644 --- a/src/HTTPServer/MultipartParser.h +++ b/src/HTTPServer/MultipartParser.h @@ -24,52 +24,52 @@ public: public: // Force a virtual destructor in descendants: virtual ~cCallbacks() {} - + /** Called when a new part starts */ virtual void OnPartStart(void) = 0; - + /** Called when a complete header line is received for a part */ virtual void OnPartHeader(const AString & a_Key, const AString & a_Value) = 0; - + /** Called when body for a part is received */ virtual void OnPartData(const char * a_Data, size_t a_Size) = 0; - + /** Called when the current part ends */ virtual void OnPartEnd(void) = 0; } ; - + /** Creates the parser, expects to find the boundary in a_ContentType */ cMultipartParser(const AString & a_ContentType, cCallbacks & a_Callbacks); - + /** Parses more incoming data */ void Parse(const char * a_Data, size_t a_Size); - + protected: /** The callbacks to call for various parsing events */ cCallbacks & m_Callbacks; - + /** True if the data parsed so far is valid; if false, further parsing is skipped */ bool m_IsValid; - + /** Parser for each part's envelope */ cEnvelopeParser m_EnvelopeParser; - + /** Buffer for the incoming data until it is parsed */ AString m_IncomingData; - + /** The boundary, excluding both the initial "--" and the terminating CRLF */ AString m_Boundary; - + /** Set to true if some data for the current part has already been signalized to m_Callbacks. Used for proper CRLF inserting. */ bool m_HasHadData; - - + + /** Parse one line of incoming data. The CRLF has already been stripped from a_Data / a_Size */ void ParseLine(const char * a_Data, size_t a_Size); - + /** Parse one line of incoming data in the headers section of a part. The CRLF has already been stripped from a_Data / a_Size */ void ParseHeaderLine(const char * a_Data, size_t a_Size); - + // cEnvelopeParser overrides: virtual void OnHeaderLine(const AString & a_Key, const AString & a_Value) override; } ; |