mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
udpsrc: Ignore G_IO_ERROR_CONNECTION_CLOSED when receiving data
This happens on Windows if we use the same socket for sending packets, and the remote sends ICMP port/host unreachable messages. https://bugzilla.gnome.org/show_bug.cgi?id=754534
This commit is contained in:
parent
f0ca2f2ecb
commit
89137fc136
1 changed files with 6 additions and 4 deletions
|
@ -576,10 +576,12 @@ retry:
|
||||||
NULL, NULL, &flags, udpsrc->cancellable, &err);
|
NULL, NULL, &flags, udpsrc->cancellable, &err);
|
||||||
|
|
||||||
if (G_UNLIKELY (res < 0)) {
|
if (G_UNLIKELY (res < 0)) {
|
||||||
/* EHOSTUNREACH for a UDP socket means that a packet sent with udpsink
|
/* G_IO_ERROR_HOST_UNREACHABLE for a UDP socket means that a packet sent
|
||||||
* generated a "port unreachable" ICMP response. We ignore that and try
|
* with udpsink generated a "port unreachable" ICMP response. We ignore
|
||||||
* again. */
|
* that and try again.
|
||||||
if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_HOST_UNREACHABLE)) {
|
* On Windows we get G_IO_ERROR_CONNECTION_CLOSED instead */
|
||||||
|
if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_HOST_UNREACHABLE) ||
|
||||||
|
g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CONNECTION_CLOSED)) {
|
||||||
g_clear_error (&err);
|
g_clear_error (&err);
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue