+2004-08-09 Wim Taymans <wim@fluendo.com>
+
+ * gst/tcp/gstmultifdsink.c: (gst_multifdsink_class_init),
+ (gst_multifdsink_add), (gst_multifdsink_get_stats),
+ (gst_multifdsink_client_remove),
+ (gst_multifdsink_handle_client_read),
+ (gst_multifdsink_handle_client_write),
+ (gst_multifdsink_queue_buffer), (gst_multifdsink_handle_clients):
+ Do a bit more logging, make the client_read code more robust.
+
2004-08-09 Thomas Vander Stichele <thomas at apestaart dot org>
* ext/jpeg/gstjpegdec.c: (gst_jpegdec_init_source),
fd = client->fd;
- ioctl (fd, FIONREAD, &avail);
+ if (ioctl (fd, FIONREAD, &avail) < 0) {
+ GST_WARNING_OBJECT (sink, "ioctl failed for fd %d", fd);
+ ret = FALSE;
+ return ret;
+ }
- GST_LOG_OBJECT (sink, "select reports client read on fd %d of %d bytes",
+ GST_DEBUG_OBJECT (sink, "select reports client read on fd %d of %d bytes",
fd, avail);
ret = TRUE;
/* client sent close, so remove it */
GST_DEBUG_OBJECT (sink, "client asked for close, removing on fd %d", fd);
ret = FALSE;
+ } else if (avail < 0) {
+ GST_WARNING_OBJECT (sink, "avail < 0, removing on fd %d", fd);
+ ret = FALSE;
} else {
guint8 dummy[512];
gint nread;
/* this is the maximum we can read */
gint to_read = MIN (avail, 512);
+ GST_DEBUG_OBJECT (sink, "client on fd %d wants us to read %d bytes",
+ fd, to_read);
+
nread = read (fd, dummy, to_read);
if (nread < -1) {
- GST_DEBUG_OBJECT (sink, "could not read bytes from fd %d: %s",
+ GST_WARNING_OBJECT (sink, "could not read bytes from fd %d: %s",
fd, g_strerror (errno));
ret = FALSE;
break;
client = (GstTCPClient *) clients->data;
- GST_LOG_OBJECT (sink, "removing client %p with fd %d with errors", client,
- client->fd);
+ GST_WARNING_OBJECT (sink, "removing client %p with fd %d with errors",
+ client, client->fd);
gst_multifdsink_client_remove (sink, client);
}
g_list_free (error);