Refine the streaming, add UT, add error handling.

This commit is contained in:
Chunting Gu
2019-08-09 16:10:16 +08:00
parent c669551552
commit feae9b7acc
17 changed files with 316 additions and 212 deletions
+1 -5
View File
@@ -39,11 +39,7 @@ const std::string& Message::data() const {
}
std::shared_ptr<FileBody> Message::file_body() const {
auto file_body = std::dynamic_pointer_cast<FileBody>(body_);
if (!file_body) {
throw Error{ Error::kDataError, "Not a file body" };
}
return file_body;
return std::dynamic_pointer_cast<FileBody>(body_);
}
bool Message::IsConnectionKeepAlive() const {