Fix dap::Socket::read()
when recv()
errors
Identified by @kuafuwang. Fixes #29
This commit is contained in:
parent
9e313445bb
commit
ad9b4588f2
@ -158,7 +158,9 @@ class dap::Socket::Shared : public dap::ReaderWriter {
|
|||||||
if (s == InvalidSocket) {
|
if (s == InvalidSocket) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return recv(s, reinterpret_cast<char*>(buffer), static_cast<int>(bytes), 0);
|
auto len =
|
||||||
|
recv(s, reinterpret_cast<char*>(buffer), static_cast<int>(bytes), 0);
|
||||||
|
return (len < 0) ? 0 : len;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool write(const void* buffer, size_t bytes) {
|
bool write(const void* buffer, size_t bytes) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user