summaryrefslogtreecommitdiffstats
path: root/src/HTTPServer/MultipartParser.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-04-01 16:36:00 +0200
committermadmaxoft <github@xoft.cz>2014-04-01 16:36:00 +0200
commit1795cca5522476006d33d0c276e27a50659c867a (patch)
treec4abcc1ac701bbaf092a729a093058601aae1e79 /src/HTTPServer/MultipartParser.h
parentRemoved the exit-time-destructors flag from clang. (diff)
downloadcuberite-1795cca5522476006d33d0c276e27a50659c867a.tar
cuberite-1795cca5522476006d33d0c276e27a50659c867a.tar.gz
cuberite-1795cca5522476006d33d0c276e27a50659c867a.tar.bz2
cuberite-1795cca5522476006d33d0c276e27a50659c867a.tar.lz
cuberite-1795cca5522476006d33d0c276e27a50659c867a.tar.xz
cuberite-1795cca5522476006d33d0c276e27a50659c867a.tar.zst
cuberite-1795cca5522476006d33d0c276e27a50659c867a.zip
Diffstat (limited to 'src/HTTPServer/MultipartParser.h')
-rw-r--r--src/HTTPServer/MultipartParser.h38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/HTTPServer/MultipartParser.h b/src/HTTPServer/MultipartParser.h
index d853929ed..a7395c1cb 100644
--- a/src/HTTPServer/MultipartParser.h
+++ b/src/HTTPServer/MultipartParser.h
@@ -22,50 +22,52 @@ public:
class cCallbacks
{
public:
- /// Called when a new part starts
+ virtual ~cCallbacks() {}
+
+ /** Called when a new part starts */
virtual void OnPartStart(void) = 0;
- /// Called when a complete header line is received for a part
+ /** 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, int a_Size) = 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
+ /** Called when the current part ends */
virtual void OnPartEnd(void) = 0;
} ;
- /// Creates the parser, expects to find the boundary in a_ContentType
+ /** 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, int a_Size);
+ /** Parses more incoming data */
+ void Parse(const char * a_Data, size_t a_Size);
protected:
- /// The callbacks to call for various parsing events
+ /** 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
+ /** True if the data parsed so far is valid; if false, further parsing is skipped */
bool m_IsValid;
- /// Parser for each part's envelope
+ /** Parser for each part's envelope */
cEnvelopeParser m_EnvelopeParser;
- /// Buffer for the incoming data until it is parsed
+ /** Buffer for the incoming data until it is parsed */
AString m_IncomingData;
- /// The boundary, excluding both the initial "--" and the terminating CRLF
+ /** 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.
+ /** 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, int a_Size);
+ /** 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, int 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;