summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2013-07-28 13:52:28 +0200
committerSebastian Dröge <slomo@circular-chaos.org>2013-07-28 13:53:22 +0200
commit6a79969b4bf209d2252bcf87d3fa8b96a1291254 (patch)
treedb3df2832154a4194b3aea781be4e869cfc41e87
parent34569f9b0d5594b313d9f215f8a5624f19d66ce9 (diff)
downloadgstreamer-plugins-base-6a79969b4bf209d2252bcf87d3fa8b96a1291254.tar.gz
multisocketsink: Fix handling of partial writes and WOULD_BLOCK errors
-rw-r--r--gst/tcp/gstmultisocketsink.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gst/tcp/gstmultisocketsink.c b/gst/tcp/gstmultisocketsink.c
index 673eb41bd..6fcc1a834 100644
--- a/gst/tcp/gstmultisocketsink.c
+++ b/gst/tcp/gstmultisocketsink.c
@@ -751,18 +751,21 @@ gst_multi_socket_sink_handle_client_write (GstMultiSocketSink * sink,
/* hmm error.. */
if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CLOSED)) {
goto connection_reset;
+ } else if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK)) {
+ /* write would block, try again later */
+ GST_LOG_OBJECT (sink, "write would block %p",
+ mhclient->handle.socket);
+ more = FALSE;
} else {
goto write_error;
}
} else {
if (wrote < maxsize) {
- /* partial write means that the client cannot read more and we should
- * stop sending more */
+ /* partial write, try again now */
GST_LOG_OBJECT (sink,
"partial write on %p of %" G_GSSIZE_FORMAT " bytes",
mhclient->handle.socket, wrote);
mhclient->bufoffset += wrote;
- more = FALSE;
} else {
/* complete buffer was written, we can proceed to the next one */
mhclient->sending = g_slist_remove (mhclient->sending, head);