Support data streaming on server side.

This commit is contained in:
Chunting Gu
2019-08-13 17:35:01 +08:00
parent 0ea4ab7526
commit 9b13dceab9
13 changed files with 167 additions and 59 deletions
-12
View File
@@ -45,18 +45,6 @@ void ResponseParser::Init(Response* response, bool stream) {
stream_ = stream;
}
void ResponseParser::CreateBodyHandler() {
if (stream_) {
try {
body_handler_.reset(new FileBodyHandler{ message_ });
} catch (const Error&) {
body_handler_.reset();
}
} else {
body_handler_.reset(new StringBodyHandler{ message_ });
}
}
bool ResponseParser::ParseStartLine(const std::string& line) {
std::vector<std::string> parts;
SplitStartLine(line, &parts);