aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/clients/httpclientcommon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenhttp/clients/httpclientcommon.cpp')
-rw-r--r--src/zenhttp/clients/httpclientcommon.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/zenhttp/clients/httpclientcommon.cpp b/src/zenhttp/clients/httpclientcommon.cpp
index 312ca16d2..c016e1c3c 100644
--- a/src/zenhttp/clients/httpclientcommon.cpp
+++ b/src/zenhttp/clients/httpclientcommon.cpp
@@ -425,12 +425,14 @@ namespace detail {
return false;
}
- void MultipartBoundaryParser::InternalParseInput(std::string_view data)
+ void MultipartBoundaryParser::ParseInput(std::string_view data)
{
- size_t ScanPos = 0;
- while (ScanPos < data.length())
+ const char* InputPtr = data.data();
+ size_t InputLength = data.length();
+ size_t ScanPos = 0;
+ while (ScanPos < InputLength)
{
- const char ScanChar = data[ScanPos];
+ const char ScanChar = InputPtr[ScanPos];
if (BoundaryBeginMatcher.MatchState == IncrementalStringMatcher::EMatchState::Complete)
{
if (PayloadOffset + ScanPos < (BoundaryBeginMatcher.GetMatchEndOffset() + BoundaryEndMatcher.GetMatchString().length()))
@@ -504,7 +506,7 @@ namespace detail {
}
ScanPos++;
}
- PayloadOffset += data.length();
+ PayloadOffset += InputLength;
}
std::pair<std::string_view, std::string_view> GetHeaderKeyAndValue(std::string_view HeaderString)