summaryrefslogtreecommitdiff
path: root/src/net/HttpParser.cpp
diff options
context:
space:
mode:
authorAlexander Zaitsev <zamazan4ik@tut.by>2020-03-13 03:56:35 +0300
committerAlexander Zaitsev <zamazan4ik@tut.by>2020-03-13 03:56:35 +0300
commit26fac5bf7e87dd5704a967ee4c744228b93d20b7 (patch)
tree74e5daa9a58f3a97b417925a212ac2cd31487a5e /src/net/HttpParser.cpp
parent806e7e5a3edf4fdf2b9c48469a7bc23307b200b0 (diff)
fix: use std::size_t instead of size_t
- use C++ size_t from std namespace instead of a version from global namespace Tested: - Local build - Unit-tests
Diffstat (limited to 'src/net/HttpParser.cpp')
-rw-r--r--src/net/HttpParser.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/net/HttpParser.cpp b/src/net/HttpParser.cpp
index 386a4d9..8006c85 100644
--- a/src/net/HttpParser.cpp
+++ b/src/net/HttpParser.cpp
@@ -1,5 +1,6 @@
#include "tgbot/net/HttpParser.h"
+#include <cstddef>
#include <cstdint>
#include <boost/algorithm/string.hpp>
@@ -133,10 +134,10 @@ string HttpParser::generateResponse(const string& data, const string& mimeType,
unordered_map<string, string> HttpParser::parseHeader(const string& data, bool isRequest) const {
unordered_map<string, string> headers;
- size_t lineStart = 0;
- size_t lineEnd = 0;
- size_t lineSepPos = 0;
- size_t lastLineEnd = string::npos;
+ std::size_t lineStart = 0;
+ std::size_t lineEnd = 0;
+ std::size_t lineSepPos = 0;
+ std::size_t lastLineEnd = string::npos;
while (lastLineEnd != lineEnd) {
lastLineEnd = lineEnd;
bool isFirstLine = lineEnd == 0;
@@ -167,7 +168,7 @@ unordered_map<string, string> HttpParser::parseHeader(const string& data, bool i
}
string HttpParser::extractBody(const string& data) const {
- size_t headerEnd = data.find("\r\n\r\n");
+ std::size_t headerEnd = data.find("\r\n\r\n");
if (headerEnd == string::npos) {
return data;
}