Fix large Bolt messages
Reviewers: ipaljak Reviewed By: ipaljak Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1490
This commit is contained in:
parent
2590bcb7db
commit
53ee007002
@ -72,6 +72,11 @@ class Session {
|
||||
*/
|
||||
void Execute() {
|
||||
if (UNLIKELY(!handshake_done_)) {
|
||||
// Resize the input buffer to ensure that a whole chunk can fit into it.
|
||||
// This can be done only once because the buffer holds its size.
|
||||
input_stream_.Resize(WHOLE_CHUNK_SIZE);
|
||||
|
||||
// Receive the handshake.
|
||||
if (input_stream_.size() < HANDSHAKE_SIZE) {
|
||||
DLOG(WARNING) << fmt::format("Received partial handshake of size {}",
|
||||
input_stream_.size());
|
||||
|
@ -34,6 +34,8 @@ class TestInputStream {
|
||||
data_.erase(data_.begin(), data_.begin() + count);
|
||||
}
|
||||
|
||||
void Resize(size_t len) {}
|
||||
|
||||
private:
|
||||
std::vector<uint8_t> data_;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user