summaryrefslogtreecommitdiffstats
path: root/ext/neon
diff options
context:
space:
mode:
authorWouter Cloetens <wouter@mind.be>2007-09-28 09:29:09 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2007-09-28 09:29:09 +0000
commitde5d4c63133e7fd3563af287a68ad2f8c261f195 (patch)
tree5ee76a27118639f287eb2ffc7d4d3c795386a406 /ext/neon
parent77e7c4aaddc9714651fe9cb4d86f760170f6564d (diff)
downloadgst-plugins-bad-de5d4c63133e7fd3563af287a68ad2f8c261f195.tar.gz
gst-plugins-bad-de5d4c63133e7fd3563af287a68ad2f8c261f195.tar.bz2
gst-plugins-bad-de5d4c63133e7fd3563af287a68ad2f8c261f195.zip
ext/neon/gstneonhttpsrc.*: Don't discard GET parameters from URL if existing.
Original commit message from CVS: Patch by: Wouter Cloetens <wouter@mind.be> * ext/neon/gstneonhttpsrc.c: (gst_neonhttp_src_dispose), (gst_neonhttp_src_set_location), (gst_neonhttp_src_send_request_and_redirect): * ext/neon/gstneonhttpsrc.h: Don't discard GET parameters from URL if existing. Fixes #481200.
Diffstat (limited to 'ext/neon')
-rw-r--r--ext/neon/gstneonhttpsrc.c18
-rw-r--r--ext/neon/gstneonhttpsrc.h1
2 files changed, 18 insertions, 1 deletions
diff --git a/ext/neon/gstneonhttpsrc.c b/ext/neon/gstneonhttpsrc.c
index 2c1c6c3a..683b5ac0 100644
--- a/ext/neon/gstneonhttpsrc.c
+++ b/ext/neon/gstneonhttpsrc.c
@@ -287,6 +287,9 @@ gst_neonhttp_src_dispose (GObject * gobject)
if (src->location) {
ne_free (src->location);
}
+ if (src->query_string) {
+ ne_free (src->query_string);
+ }
G_OBJECT_CLASS (parent_class)->dispose (gobject);
}
@@ -706,6 +709,10 @@ gst_neonhttp_src_set_location (GstNeonhttpSrc * src, const gchar * uri)
ne_free (src->location);
src->location = NULL;
}
+ if (src->query_string) {
+ ne_free (src->query_string);
+ src->query_string = NULL;
+ }
if (ne_uri_parse (uri, &src->uri) != 0)
goto parse_error;
@@ -726,6 +733,11 @@ gst_neonhttp_src_set_location (GstNeonhttpSrc * src, const gchar * uri)
if (!src->uri.path)
src->uri.path = g_strdup ("");
+ if (src->uri.query)
+ src->query_string = g_strjoin ("?", src->uri.path, src->uri.query, NULL);
+ else
+ src->query_string = g_strdup (src->uri.path);
+
src->location = ne_uri_unparse (&src->uri);
return TRUE;
@@ -737,6 +749,10 @@ parse_error:
ne_free (src->location);
src->location = NULL;
}
+ if (src->query_string) {
+ ne_free (src->query_string);
+ src->query_string = NULL;
+ }
ne_uri_free (&src->uri);
return FALSE;
}
@@ -804,7 +820,7 @@ gst_neonhttp_src_send_request_and_redirect (GstNeonhttpSrc * src,
ne_set_session_flag (session, NE_SESSFLAG_ICYPROTO, 1);
#endif
- request = ne_request_create (session, "GET", src->uri.path);
+ request = ne_request_create (session, "GET", src->query_string);
if (src->user_agent) {
ne_add_request_header (request, "User-Agent", src->user_agent);
diff --git a/ext/neon/gstneonhttpsrc.h b/ext/neon/gstneonhttpsrc.h
index f5f759e4..68383485 100644
--- a/ext/neon/gstneonhttpsrc.h
+++ b/ext/neon/gstneonhttpsrc.h
@@ -49,6 +49,7 @@ struct _GstNeonhttpSrc {
ne_request *request;
ne_uri uri;
gchar *location;
+ gchar *query_string;
ne_uri proxy;
gchar *user_agent;