mirror of https://github.com/oxen-io/lokinet
Fix read problem in linux
errno is only set if read returns < 0 and won't be set to 0 if read succeeds, so we were bailing here frequently on successful reads (whenever errno happened to be non-0).
This commit is contained in:
parent
15443568db
commit
b9c9ee1ca7
|
@ -110,7 +110,7 @@ namespace llarp::vpn
|
|||
std::vector<byte_t> pkt;
|
||||
pkt.resize(net::IPPacket::MaxSize);
|
||||
const auto sz = read(m_fd, pkt.data(), pkt.capacity());
|
||||
if (errno)
|
||||
if (sz < 0)
|
||||
{
|
||||
if (errno == EAGAIN or errno == EWOULDBLOCK)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue