mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 18:51:11 +00:00
multisocketsink: Fix handling of partial writes and WOULD_BLOCK errors
This commit is contained in:
parent
692fd81ac7
commit
b12cd5432a
1 changed files with 6 additions and 3 deletions
|
@ -750,18 +750,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);
|
||||
|
|
Loading…
Reference in a new issue