Move most StreamBuffer code into base-buffer.hpp

This commit is contained in:
2023-10-18 17:23:05 -04:00
parent 6c2a27b274
commit 049b0b893a
10 changed files with 822 additions and 808 deletions

View File

@@ -204,10 +204,7 @@ public:
int64_t nactor = world_->patch_everything(sb, &dbc);
if (nactor != actor_id_) change_actor_id(nactor);
dbc.dump(stdostream());
} catch (const StreamEof &seof) {
abandon_server();
return;
} catch (const StreamCorruption &scorr) {
} catch (const StreamException &sexcept) {
abandon_server();
return;
}
@@ -222,7 +219,8 @@ public:
sb->unread_to(tr_before);
return false;
}
StreamBuffer body(sb->read_bytes(message_body_len), message_body_len);
const char *message_body = sb->read_bytes(message_body_len);
StreamBuffer body(std::string_view(message_body, message_body_len));
if (message_type == util::MSG_ACK) {
receive_ack_from_server(&body);
} else if (message_type == util::MSG_DIFF) {