module-raop: handle and debug read errors

Fixes #2183
This commit is contained in:
Wim Taymans 2022-03-02 11:28:43 +01:00
parent 00d4de3799
commit fdaf4613d8

View file

@ -584,6 +584,10 @@ on_timing_source_io(void *data, int fd, uint32_t mask)
received = ntp_now(CLOCK_MONOTONIC); received = ntp_now(CLOCK_MONOTONIC);
bytes = read(impl->timing_fd, packet, sizeof(packet)); bytes = read(impl->timing_fd, packet, sizeof(packet));
if (bytes < 0) {
pw_log_debug("error reading timing packet: %m");
return;
}
if (bytes != sizeof(packet)) { if (bytes != sizeof(packet)) {
pw_log_warn("discarding short (%zd < %zd) timing packet", pw_log_warn("discarding short (%zd < %zd) timing packet",
bytes, sizeof(bytes)); bytes, sizeof(bytes));
@ -610,6 +614,10 @@ on_control_source_io(void *data, int fd, uint32_t mask)
uint16_t seq, num; uint16_t seq, num;
bytes = read(impl->control_fd, packet, sizeof(packet)); bytes = read(impl->control_fd, packet, sizeof(packet));
if (bytes < 0) {
pw_log_debug("error reading control packet: %m");
return;
}
if (bytes != sizeof(packet)) { if (bytes != sizeof(packet)) {
pw_log_warn("discarding short (%zd < %zd) control packet", pw_log_warn("discarding short (%zd < %zd) control packet",
bytes, sizeof(bytes)); bytes, sizeof(bytes));