aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/servers
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-02-20 09:05:23 +0100
committerGitHub Enterprise <[email protected]>2026-02-20 09:05:23 +0100
commitee26e5af2ced0987fbdf666dc6bce7c2074e925f (patch)
tree7d8e6c614d62a9d31e85d2b508c4b209ebb847bc /src/zenhttp/servers
parent5.7.21 (diff)
downloadzen-ee26e5af2ced0987fbdf666dc6bce7c2074e925f.tar.xz
zen-ee26e5af2ced0987fbdf666dc6bce7c2074e925f.zip
GC - fix handling of attachment ranges, http access token expiration, lock file retry logic (#766)
* GC - fix handling of attachment ranges * fix trace/log strings * fix HTTP access token expiration time logic * added missing lock retry in zenserver startup
Diffstat (limited to 'src/zenhttp/servers')
-rw-r--r--src/zenhttp/servers/httpparser.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/zenhttp/servers/httpparser.cpp b/src/zenhttp/servers/httpparser.cpp
index be5befcd2..f0485aa25 100644
--- a/src/zenhttp/servers/httpparser.cpp
+++ b/src/zenhttp/servers/httpparser.cpp
@@ -226,6 +226,8 @@ NormalizeUrlPath(std::string_view InUrl, std::string& NormalizedUrl)
NormalizedUrl.append(Url, UrlIndex);
}
+ // NOTE: this check is redundant given the enclosing if,
+ // need to verify the intent of this code
if (!LastCharWasSeparator)
{
NormalizedUrl.push_back('/');
@@ -310,6 +312,7 @@ HttpRequestParser::OnHeadersComplete()
if (ContentLength)
{
+ // TODO: should sanity-check content length here
m_BodyBuffer = IoBuffer(ContentLength);
}
@@ -329,9 +332,9 @@ HttpRequestParser::OnHeadersComplete()
int
HttpRequestParser::OnBody(const char* Data, size_t Bytes)
{
- if (m_BodyPosition + Bytes > m_BodyBuffer.Size())
+ if ((m_BodyPosition + Bytes) > m_BodyBuffer.Size())
{
- ZEN_WARN("HTTP parser incoming body is larger than content size, need {} more bytes",
+ ZEN_WARN("HTTP parser incoming body is larger than content size, need {} more buffer bytes",
(m_BodyPosition + Bytes) - m_BodyBuffer.Size());
return 1;
}
@@ -342,7 +345,7 @@ HttpRequestParser::OnBody(const char* Data, size_t Bytes)
{
if (m_BodyPosition != m_BodyBuffer.Size())
{
- ZEN_WARN("Body mismatch! {} != {}", m_BodyPosition, m_BodyBuffer.Size());
+ ZEN_WARN("Body size mismatch! {} != {}", m_BodyPosition, m_BodyBuffer.Size());
return 1;
}
}