g_mutex_init (&src->mutex);
g_cond_init (&src->request_finished_cond);
src->location = NULL;
+ src->redirection_uri = NULL;
src->automatic_redirect = TRUE;
src->user_agent = g_strdup (DEFAULT_USER_AGENT);
src->user_id = NULL;
g_mutex_clear (&src->mutex);
g_cond_clear (&src->request_finished_cond);
g_free (src->location);
+ if (src->redirection_uri) {
+ g_free (src->redirection_uri);
+ }
g_free (src->user_agent);
if (src->proxy != NULL) {
soup_uri_free (src->proxy);
return;
if (src->automatic_redirect && SOUP_STATUS_IS_REDIRECTION (msg->status_code)) {
+ src->redirection_uri = g_strdup (soup_message_headers_get
+ (msg->response_headers, "Location"));
GST_DEBUG_OBJECT (src, "%u redirect to \"%s\"", msg->status_code,
- soup_message_headers_get_one (msg->response_headers, "Location"));
+ src->redirection_uri);
return;
}
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_URI:
gst_query_set_uri (query, src->location);
+ gst_query_set_uri_redirection (query, src->redirection_uri);
ret = TRUE;
break;
default:
}
}
+ if (src->redirection_uri) {
+ g_free (src->redirection_uri);
+ src->redirection_uri = NULL;
+ }
+
src->location = g_strdup (uri);
return TRUE;
GstPushSrc element;
gchar *location; /* Full URI. */
+ gchar *redirection_uri; /* Full URI after redirections. */
gchar *user_agent; /* User-Agent HTTP header. */
gboolean automatic_redirect; /* Follow redirects. */
SoupURI *proxy; /* HTTP proxy URI. */