diff options
| author | tecnovert <[email protected]> | 2019-07-18 13:04:16 +0200 |
|---|---|---|
| committer | tecnovert <[email protected]> | 2019-07-18 13:04:16 +0200 |
| commit | a52818cc5633494992da7d1dc8fdb04b4a1b7c29 (patch) | |
| tree | 91f658baa3eb5d3d5a66448335599b546412e279 /src | |
| parent | Merge #16374: test: Enable passing wildcard test names to test runner from root (diff) | |
| download | discoin-a52818cc5633494992da7d1dc8fdb04b4a1b7c29.tar.xz discoin-a52818cc5633494992da7d1dc8fdb04b4a1b7c29.zip | |
net: Make poll in InterruptibleRecv only filter for POLLIN events.
poll should block until there is data to be read or the timeout expires.
Filtering for the POLLOUT event causes poll to return immediately which leads to high CPU usage when trying to connect to non-responding peers through tor.
Removing POLLOUT matches how select is used when USE_POLL isn't defined.
Diffstat (limited to 'src')
| -rw-r--r-- | src/netbase.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp index 53e5985a0..6d4738c83 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -347,7 +347,7 @@ static IntrRecvError InterruptibleRecv(uint8_t* data, size_t len, int timeout, c #ifdef USE_POLL struct pollfd pollfd = {}; pollfd.fd = hSocket; - pollfd.events = POLLIN | POLLOUT; + pollfd.events = POLLIN; int nRet = poll(&pollfd, 1, timeout_ms); #else struct timeval tval = MillisToTimeval(timeout_ms); |