From 89137fc13624f918bc2261fed29c93f9620cc974 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 4 Sep 2015 12:01:52 +0300 Subject: [PATCH] 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 --- gst/udp/gstudpsrc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c index 8fdb868..b6b2e20 100644 --- a/gst/udp/gstudpsrc.c +++ b/gst/udp/gstudpsrc.c @@ -576,10 +576,12 @@ retry: NULL, NULL, &flags, udpsrc->cancellable, &err); if (G_UNLIKELY (res < 0)) { - /* EHOSTUNREACH for a UDP socket means that a packet sent with udpsink - * generated a "port unreachable" ICMP response. We ignore that and try - * again. */ - if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_HOST_UNREACHABLE)) { + /* G_IO_ERROR_HOST_UNREACHABLE for a UDP socket means that a packet sent + * with udpsink generated a "port unreachable" ICMP response. We ignore + * that and try again. + * 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); goto retry; } -- 2.7.4