mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 15:48:23 +00:00
dccp: avoid indefinite looping upon error
... and fix 'uninitialized' compilation warning as well.
This commit is contained in:
parent
837763fee8
commit
df86df9ddf
1 changed files with 6 additions and 3 deletions
|
@ -333,7 +333,7 @@ gst_dccp_socket_write (GstElement * element, int socket, const void *buf,
|
|||
size_t size, int packet_size)
|
||||
{
|
||||
size_t bytes_written = 0;
|
||||
ssize_t wrote;
|
||||
ssize_t wrote = 0;
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
struct iovec iov;
|
||||
|
@ -362,8 +362,11 @@ gst_dccp_socket_write (GstElement * element, int socket, const void *buf,
|
|||
} while (wrote == SOCKET_ERROR && errorCode == EAGAIN);
|
||||
#endif
|
||||
|
||||
/* TODO print the send error */
|
||||
bytes_written += wrote;
|
||||
/* give up on error */
|
||||
if (wrote >= 0)
|
||||
bytes_written += wrote;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (wrote < 0)
|
||||
|
|
Loading…
Reference in a new issue