mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +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 size, int packet_size)
|
||||||
{
|
{
|
||||||
size_t bytes_written = 0;
|
size_t bytes_written = 0;
|
||||||
ssize_t wrote;
|
ssize_t wrote = 0;
|
||||||
|
|
||||||
#ifndef G_OS_WIN32
|
#ifndef G_OS_WIN32
|
||||||
struct iovec iov;
|
struct iovec iov;
|
||||||
|
@ -362,8 +362,11 @@ gst_dccp_socket_write (GstElement * element, int socket, const void *buf,
|
||||||
} while (wrote == SOCKET_ERROR && errorCode == EAGAIN);
|
} while (wrote == SOCKET_ERROR && errorCode == EAGAIN);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* TODO print the send error */
|
/* give up on error */
|
||||||
bytes_written += wrote;
|
if (wrote >= 0)
|
||||||
|
bytes_written += wrote;
|
||||||
|
else
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wrote < 0)
|
if (wrote < 0)
|
||||||
|
|
Loading…
Reference in a new issue