Errors previously were caught by sheer luck due to the fact that bytes
was declared size_t (unsigned), thus -1 mapping to typeof(size_t)_MAX
which most likely fullfilled the case of bytes > BUF_SIZE
socket_source_cb (GSSDPSocketSource *socket, GSSDPClient *client)
{
int fd, type, len;
- size_t bytes;
+ ssize_t bytes;
char buf[BUF_SIZE], *end;
struct sockaddr_in addr;
socklen_t addr_size;
MSG_TRUNC,
(struct sockaddr *) &addr,
&addr_size);
+ if (bytes == -1) {
+ g_warning ("Failed to read from socket: %d (%s)",
+ errno,
+ strerror (errno));
+
+ return TRUE;
+ }
/* We need the following lines to make sure the right client received
* the packet. We won't need to do this if there was any way to tell