From 5964247829b8b6011b535be0dcfafc572467b809 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 25 Jan 2018 12:09:03 +0000 Subject: [PATCH] mount-points: bail out of loop again when matching mount points Previous patch led to us iterating the entire sequence. Bail out of the loop again if we have a match but are moving away from it. https://bugzilla.gnome.org/show_bug.cgi?id=771555 --- gst/rtsp-server/rtsp-mount-points.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst/rtsp-server/rtsp-mount-points.c b/gst/rtsp-server/rtsp-mount-points.c index 77d82ed..858c391 100644 --- a/gst/rtsp-server/rtsp-mount-points.c +++ b/gst/rtsp-server/rtsp-mount-points.c @@ -277,6 +277,11 @@ gst_rtsp_mount_points_match (GstRTSPMountPoints * mounts, data_item_dump (ritem, "new best: "); } best = iter; + } else { + /* if have a match and the current item doesn't prefix match the best we + * found so far then we're moving away and can bail out of the loop */ + if (best != NULL && !has_prefix (ritem, g_sequence_get (best))) + break; } iter = g_sequence_iter_next (iter); -- 2.7.4