We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6fb92f8 commit 413d51eCopy full SHA for 413d51e
src/libstd/rt/uv/net.rs
@@ -392,6 +392,13 @@ impl UdpWatcher {
392
393
extern fn recv_cb(handle: *uvll::uv_udp_t, nread: ssize_t, buf: Buf,
394
addr: *uvll::sockaddr, flags: c_uint) {
395
+ // When there's no data to read the recv callback can be a no-op.
396
+ // This can happen if read returns EAGAIN/EWOULDBLOCK. By ignoring
397
+ // this we just drop back to kqueue and wait for the next callback.
398
+ if nread == 0 {
399
+ return;
400
+ }
401
+
402
rtdebug!("buf addr: %x", buf.base as uint);
403
rtdebug!("buf len: %d", buf.len as int);
404
let mut udp_watcher: UdpWatcher = NativeHandle::from_native_handle(handle);
0 commit comments