Refine the parsing of response status line; add UT for utility.

This commit is contained in:
Chunting Gu
2019-05-31 13:43:44 +08:00
parent 78743e6a55
commit 2035c1f552
10 changed files with 81 additions and 21 deletions
+3 -3
View File
@@ -15,9 +15,9 @@ std::string RandomUuid() {
return ss.str();
}
bool Split2(const std::string& str, char token, std::string* part1,
std::string* part2) {
std::size_t pos = str.find(token);
bool SplitKV(const std::string& str, char delimiter,
std::string* part1, std::string* part2) {
std::size_t pos = str.find(delimiter);
if (pos == std::string::npos) {
return false;
}