ptp: On Windows handle socket polls that result in no error but also no FD_READ event

According to the documentation this should never happen but apparently
does under certain circumstances. As the sockets are set non-blocking,
trying to read from them regardless should not cause any problems.

In all cases that were observed so far, the socket in question actually
has a packet queued up for reading.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4748>
This commit is contained in:
Sebastian Dröge 2023-05-31 13:15:13 +03:00 committed by GStreamer Marge Bot
parent a7b09098b9
commit 98c5ceb73f

View file

@ -696,7 +696,17 @@ mod imp {
if res == 0 { "event" } else { "general" },
);
}
assert!(networkevents.lnetworkevents & FD_READ != 0);
// FIXME: This seems to happen every now and then although it shouldn't, and in
// that case a packet always seems to be queued up on the socket. As the sockets
// are non-blocking it also wouldn't be a problem otherwise, so let's just log this
// here and ignore it.
if networkevents.lnetworkevents & FD_READ == 0 {
debug!(
"Socket {} woke up but has neither an error nor a FD_READ event",
res
);
}
}
Ok(PollResult {