Fixed bolt client endless loop when server dies.
Reviewers: buda Reviewed By: buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D879
This commit is contained in:
parent
1f8d532fe9
commit
45a02b56f8
@ -131,7 +131,7 @@ class Client {
|
||||
std::vector<std::vector<DecodedValue>> records;
|
||||
while (true) {
|
||||
if (!GetDataByChunk()) {
|
||||
throw ClientInvalidDataException();
|
||||
throw ClientSocketException();
|
||||
}
|
||||
if (!decoder_.ReadMessageHeader(&signature, &marker)) {
|
||||
throw ClientInvalidDataException();
|
||||
@ -198,7 +198,7 @@ class Client {
|
||||
while (buffer_.size() < len) {
|
||||
auto buff = buffer_.Allocate();
|
||||
int ret = socket_.Read(buff.data, buff.len);
|
||||
if (ret == -1) return false;
|
||||
if (ret <= 0) return false;
|
||||
buffer_.Written(ret);
|
||||
}
|
||||
return true;
|
||||
@ -213,7 +213,7 @@ class Client {
|
||||
}
|
||||
auto buff = buffer_.Allocate();
|
||||
int ret = socket_.Read(buff.data, buff.len);
|
||||
if (ret == -1) return false;
|
||||
if (ret <= 0) return false;
|
||||
buffer_.Written(ret);
|
||||
}
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user