don't leak
Original commit message from CVS: don't leak
This commit is contained in:
parent
b5580efd05
commit
cdb0c05c98
@ -296,6 +296,15 @@ gst_tcpserversink_handle_client_write (GstTCPServerSink * sink, int fd,
|
|||||||
/* FIXME: there should be a better way to report problems, since we
|
/* FIXME: there should be a better way to report problems, since we
|
||||||
want to continue for other clients and just drop this particular one */
|
want to continue for other clients and just drop this particular one */
|
||||||
g_warning ("Write failed: %d of %d written", wrote, GST_BUFFER_SIZE (buf));
|
g_warning ("Write failed: %d of %d written", wrote, GST_BUFFER_SIZE (buf));
|
||||||
|
/* write failed, so drop the client */
|
||||||
|
GST_DEBUG_OBJECT (sink, "removing client on fd %d", fd);
|
||||||
|
if (close (fd) != 0) {
|
||||||
|
GST_DEBUG_OBJECT (sink, "error closing fd %d after failed write: %s",
|
||||||
|
fd, g_strerror (errno));
|
||||||
|
}
|
||||||
|
FD_CLR (fd, &sink->clientfds);
|
||||||
|
FD_CLR (fd, &sink->caps_sent);
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -383,10 +392,12 @@ gst_tcpserversink_chain (GstPad * pad, GstData * _data)
|
|||||||
/* Check the writes */
|
/* Check the writes */
|
||||||
for (fd = 0; fd < FD_SETSIZE; fd++) {
|
for (fd = 0; fd < FD_SETSIZE; fd++) {
|
||||||
if (FD_ISSET (fd, &testwritefds)) {
|
if (FD_ISSET (fd, &testwritefds)) {
|
||||||
if (!gst_tcpserversink_handle_client_write (sink, fd, pad, buf))
|
if (!gst_tcpserversink_handle_client_write (sink, fd, pad, buf)) {
|
||||||
|
gst_buffer_unref (buf);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
sink->data_written += GST_BUFFER_SIZE (buf);
|
sink->data_written += GST_BUFFER_SIZE (buf);
|
||||||
|
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user