diff options
author | Michael Smith <msmith@xiph.org> | 2008-07-31 17:16:50 +0000 |
---|---|---|
committer | Michael Smith <msmith@xiph.org> | 2008-07-31 17:16:50 +0000 |
commit | 26b51b2d9ccb88e68ea0588c66b99b7fb2a2b4b8 (patch) | |
tree | 52816b0893786181cd7f6abdd420d45a60f49e1d /gst/gsturi.c | |
parent | 1695ddb9dd333d77dc5aa3bc72f59f400d9e66cd (diff) | |
download | gstreamer-26b51b2d9ccb88e68ea0588c66b99b7fb2a2b4b8.tar.gz |
gst/gsturi.c: Be more liberal in what URIs we accept.
Original commit message from CVS:
* gst/gsturi.c:
Be more liberal in what URIs we accept.
Do not unescape bits of the URI for no apparent reason before passing to
the element. Fixes #545352.
Diffstat (limited to 'gst/gsturi.c')
-rw-r--r-- | gst/gsturi.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gst/gsturi.c b/gst/gsturi.c index 6890a8bae7..bd0f4d82de 100644 --- a/gst/gsturi.c +++ b/gst/gsturi.c @@ -336,7 +336,7 @@ gst_uri_protocol_is_valid (const gchar * protocol) * @uri: A URI string * * Tests if the given string is a valid URI identifier. URIs start with a valid - * protocol followed by "://" and maybe a string identifying the location. + * scheme followed by ":" and maybe a string identifying the location. * * Returns: TRUE if the string is a valid URI */ @@ -349,7 +349,7 @@ gst_uri_is_valid (const gchar * uri) gst_uri_protocol_check_internal (uri, &endptr); - return (*endptr == ':' && *(endptr + 1) == '/' && *(endptr + 2) == '/'); + return *endptr == ':'; } /** @@ -369,7 +369,7 @@ gst_uri_get_protocol (const gchar * uri) g_return_val_if_fail (uri != NULL, NULL); g_return_val_if_fail (gst_uri_is_valid (uri), NULL); - colon = strstr (uri, "://"); + colon = strstr (uri, ":"); return g_ascii_strdown (uri, colon - uri); } @@ -394,7 +394,7 @@ gst_uri_has_protocol (const gchar * uri, const gchar * protocol) g_return_val_if_fail (protocol != NULL, FALSE); g_return_val_if_fail (gst_uri_is_valid (uri), FALSE); - colon = strstr (uri, "://"); + colon = strstr (uri, ":"); if (colon == NULL) return FALSE; @@ -721,7 +721,7 @@ gst_uri_handler_set_uri (GstURIHandler * handler, const gchar * uri) { GstURIHandlerInterface *iface; gboolean ret; - gchar *new_uri, *protocol, *location; + gchar *new_uri, *protocol, *location, *colon; g_return_val_if_fail (GST_IS_URI_HANDLER (handler), FALSE); g_return_val_if_fail (gst_uri_is_valid (uri), FALSE); @@ -731,8 +731,11 @@ gst_uri_handler_set_uri (GstURIHandler * handler, const gchar * uri) g_return_val_if_fail (iface->set_uri != NULL, FALSE); protocol = gst_uri_get_protocol (uri); - location = gst_uri_get_location (uri); - new_uri = g_strdup_printf ("%s://%s", protocol, location); + + colon = strstr (uri, ":"); + location = g_strdup (colon); + + new_uri = g_strdup_printf ("%s%s", protocol, location); ret = iface->set_uri (handler, uri); |