diff options
author | Alexander Harkness <me@bearbin.net> | 2024-11-02 22:27:47 +0100 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2024-11-02 22:27:47 +0100 |
commit | cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a (patch) | |
tree | f647b20e1823f1846af88e832cf82a4a02e96e69 /src/HTTP/HTTPMessageParser.cpp | |
parent | Improve clang-format config file, remove automatically enforced code style from contrib guide. (diff) | |
download | cuberite-cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a.tar cuberite-cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a.tar.gz cuberite-cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a.tar.bz2 cuberite-cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a.tar.lz cuberite-cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a.tar.xz cuberite-cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a.tar.zst cuberite-cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a.zip |
Diffstat (limited to 'src/HTTP/HTTPMessageParser.cpp')
-rw-r--r-- | src/HTTP/HTTPMessageParser.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/HTTP/HTTPMessageParser.cpp b/src/HTTP/HTTPMessageParser.cpp index de3cf6518..759639f96 100644 --- a/src/HTTP/HTTPMessageParser.cpp +++ b/src/HTTP/HTTPMessageParser.cpp @@ -11,9 +11,8 @@ -cHTTPMessageParser::cHTTPMessageParser(cHTTPMessageParser::cCallbacks & a_Callbacks): - m_Callbacks(a_Callbacks), - m_EnvelopeParser(*this) +cHTTPMessageParser::cHTTPMessageParser(cHTTPMessageParser::cCallbacks & a_Callbacks) : + m_Callbacks(a_Callbacks), m_EnvelopeParser(*this) { Reset(); } @@ -36,7 +35,9 @@ size_t cHTTPMessageParser::Parse(const char * a_Data, size_t a_Size) { m_Buffer.append(a_Data, a_Size); auto bytesConsumedFirstLine = ParseFirstLine(); - ASSERT(bytesConsumedFirstLine <= inBufferSoFar + a_Size); // Haven't consumed more data than there is in the buffer + ASSERT( + bytesConsumedFirstLine <= inBufferSoFar + a_Size + ); // Haven't consumed more data than there is in the buffer ASSERT(bytesConsumedFirstLine > inBufferSoFar); // Have consumed at least the previous buffer contents if (m_FirstLine.empty()) { @@ -55,7 +56,9 @@ size_t cHTTPMessageParser::Parse(const char * a_Data, size_t a_Size) m_Callbacks.OnError("Failed to parse the envelope"); return AString::npos; } - ASSERT(bytesConsumedEnvelope <= bytesConsumedFirstLine + a_Size); // Haven't consumed more data than there was in the buffer + ASSERT( + bytesConsumedEnvelope <= bytesConsumedFirstLine + a_Size + ); // Haven't consumed more data than there was in the buffer m_Buffer.erase(0, bytesConsumedEnvelope); if (!m_EnvelopeParser.IsInHeaders()) { @@ -218,7 +221,3 @@ void cHTTPMessageParser::OnBodyFinished(void) m_IsFinished = true; m_Callbacks.OnBodyFinished(); } - - - - |