ext/soup/gstsouphttpsrc.c: Fix HTTP auth support with user/password passed via the URI.
Original commit message from CVS: Patch by: Jason Donenfeld <BugZilla at zx2c4 dot com> * ext/soup/gstsouphttpsrc.c: (gst_soup_http_src_got_headers_cb): Fix HTTP auth support with user/password passed via the URI. Fixes bug #540067.
This commit is contained in:
parent
e6d9cd5f16
commit
000fa87cdf
@ -1,3 +1,11 @@
|
|||||||
|
2008-06-25 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
|
||||||
|
Patch by: Jason Donenfeld <BugZilla at zx2c4 dot com>
|
||||||
|
|
||||||
|
* ext/soup/gstsouphttpsrc.c: (gst_soup_http_src_got_headers_cb):
|
||||||
|
Fix HTTP auth support with user/password passed via the URI.
|
||||||
|
Fixes bug #540067.
|
||||||
|
|
||||||
2008-06-24 Tim-Philipp Müller <tim.muller at collabora co uk>
|
2008-06-24 Tim-Philipp Müller <tim.muller at collabora co uk>
|
||||||
|
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
|
@ -135,6 +135,7 @@ static void gst_soup_http_src_uri_handler_init (gpointer g_iface,
|
|||||||
static void gst_soup_http_src_init (GstSoupHTTPSrc * src,
|
static void gst_soup_http_src_init (GstSoupHTTPSrc * src,
|
||||||
GstSoupHTTPSrcClass * g_class);
|
GstSoupHTTPSrcClass * g_class);
|
||||||
static void gst_soup_http_src_dispose (GObject * gobject);
|
static void gst_soup_http_src_dispose (GObject * gobject);
|
||||||
|
|
||||||
static void gst_soup_http_src_set_property (GObject * object, guint prop_id,
|
static void gst_soup_http_src_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec);
|
const GValue * value, GParamSpec * pspec);
|
||||||
static void gst_soup_http_src_get_property (GObject * object, guint prop_id,
|
static void gst_soup_http_src_get_property (GObject * object, guint prop_id,
|
||||||
@ -143,12 +144,17 @@ static void gst_soup_http_src_get_property (GObject * object, guint prop_id,
|
|||||||
static GstFlowReturn gst_soup_http_src_create (GstPushSrc * psrc,
|
static GstFlowReturn gst_soup_http_src_create (GstPushSrc * psrc,
|
||||||
GstBuffer ** outbuf);
|
GstBuffer ** outbuf);
|
||||||
static gboolean gst_soup_http_src_start (GstBaseSrc * bsrc);
|
static gboolean gst_soup_http_src_start (GstBaseSrc * bsrc);
|
||||||
|
|
||||||
static gboolean gst_soup_http_src_stop (GstBaseSrc * bsrc);
|
static gboolean gst_soup_http_src_stop (GstBaseSrc * bsrc);
|
||||||
|
|
||||||
static gboolean gst_soup_http_src_get_size (GstBaseSrc * bsrc, guint64 * size);
|
static gboolean gst_soup_http_src_get_size (GstBaseSrc * bsrc, guint64 * size);
|
||||||
|
|
||||||
static gboolean gst_soup_http_src_is_seekable (GstBaseSrc * bsrc);
|
static gboolean gst_soup_http_src_is_seekable (GstBaseSrc * bsrc);
|
||||||
|
|
||||||
static gboolean gst_soup_http_src_do_seek (GstBaseSrc * bsrc,
|
static gboolean gst_soup_http_src_do_seek (GstBaseSrc * bsrc,
|
||||||
GstSegment * segment);
|
GstSegment * segment);
|
||||||
static gboolean gst_soup_http_src_unlock (GstBaseSrc * bsrc);
|
static gboolean gst_soup_http_src_unlock (GstBaseSrc * bsrc);
|
||||||
|
|
||||||
static gboolean gst_soup_http_src_unlock_stop (GstBaseSrc * bsrc);
|
static gboolean gst_soup_http_src_unlock_stop (GstBaseSrc * bsrc);
|
||||||
|
|
||||||
static gboolean gst_soup_http_src_set_location (GstSoupHTTPSrc * src,
|
static gboolean gst_soup_http_src_set_location (GstSoupHTTPSrc * src,
|
||||||
@ -159,16 +165,23 @@ static gboolean gst_soup_http_src_set_proxy (GstSoupHTTPSrc * src,
|
|||||||
static char *gst_soup_http_src_unicodify (const char *str);
|
static char *gst_soup_http_src_unicodify (const char *str);
|
||||||
|
|
||||||
static gboolean gst_soup_http_src_build_message (GstSoupHTTPSrc * src);
|
static gboolean gst_soup_http_src_build_message (GstSoupHTTPSrc * src);
|
||||||
|
|
||||||
static void gst_soup_http_src_cancel_message (GstSoupHTTPSrc * src);
|
static void gst_soup_http_src_cancel_message (GstSoupHTTPSrc * src);
|
||||||
|
|
||||||
static void gst_soup_http_src_queue_message (GstSoupHTTPSrc * src);
|
static void gst_soup_http_src_queue_message (GstSoupHTTPSrc * src);
|
||||||
|
|
||||||
static gboolean gst_soup_http_src_add_range_header (GstSoupHTTPSrc * src,
|
static gboolean gst_soup_http_src_add_range_header (GstSoupHTTPSrc * src,
|
||||||
guint64 offset);
|
guint64 offset);
|
||||||
static void gst_soup_http_src_session_unpause_message (GstSoupHTTPSrc * src);
|
static void gst_soup_http_src_session_unpause_message (GstSoupHTTPSrc * src);
|
||||||
|
|
||||||
static void gst_soup_http_src_session_pause_message (GstSoupHTTPSrc * src);
|
static void gst_soup_http_src_session_pause_message (GstSoupHTTPSrc * src);
|
||||||
|
|
||||||
static void gst_soup_http_src_session_close (GstSoupHTTPSrc * src);
|
static void gst_soup_http_src_session_close (GstSoupHTTPSrc * src);
|
||||||
|
|
||||||
static void gst_soup_http_src_parse_status (SoupMessage * msg,
|
static void gst_soup_http_src_parse_status (SoupMessage * msg,
|
||||||
GstSoupHTTPSrc * src);
|
GstSoupHTTPSrc * src);
|
||||||
static void gst_soup_http_src_chunk_free (gpointer gstbuf);
|
static void gst_soup_http_src_chunk_free (gpointer gstbuf);
|
||||||
|
|
||||||
static SoupBuffer *gst_soup_http_src_chunk_allocator (SoupMessage * msg,
|
static SoupBuffer *gst_soup_http_src_chunk_allocator (SoupMessage * msg,
|
||||||
gsize max_len, gpointer user_data);
|
gsize max_len, gpointer user_data);
|
||||||
static void gst_soup_http_src_got_chunk_cb (SoupMessage * msg,
|
static void gst_soup_http_src_got_chunk_cb (SoupMessage * msg,
|
||||||
@ -216,7 +229,9 @@ static void
|
|||||||
gst_soup_http_src_class_init (GstSoupHTTPSrcClass * klass)
|
gst_soup_http_src_class_init (GstSoupHTTPSrcClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
|
||||||
GstBaseSrcClass *gstbasesrc_class;
|
GstBaseSrcClass *gstbasesrc_class;
|
||||||
|
|
||||||
GstPushSrcClass *gstpushsrc_class;
|
GstPushSrcClass *gstpushsrc_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
@ -498,6 +513,7 @@ static gboolean
|
|||||||
gst_soup_http_src_add_range_header (GstSoupHTTPSrc * src, guint64 offset)
|
gst_soup_http_src_add_range_header (GstSoupHTTPSrc * src, guint64 offset)
|
||||||
{
|
{
|
||||||
gchar buf[64];
|
gchar buf[64];
|
||||||
|
|
||||||
gint rc;
|
gint rc;
|
||||||
|
|
||||||
soup_message_headers_remove (src->msg->request_headers, "Range");
|
soup_message_headers_remove (src->msg->request_headers, "Range");
|
||||||
@ -538,8 +554,11 @@ static void
|
|||||||
gst_soup_http_src_got_headers_cb (SoupMessage * msg, GstSoupHTTPSrc * src)
|
gst_soup_http_src_got_headers_cb (SoupMessage * msg, GstSoupHTTPSrc * src)
|
||||||
{
|
{
|
||||||
const char *value;
|
const char *value;
|
||||||
|
|
||||||
GstTagList *tag_list;
|
GstTagList *tag_list;
|
||||||
|
|
||||||
GstBaseSrc *basesrc;
|
GstBaseSrc *basesrc;
|
||||||
|
|
||||||
guint64 newsize;
|
guint64 newsize;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (src, "got headers");
|
GST_DEBUG_OBJECT (src, "got headers");
|
||||||
@ -550,6 +569,9 @@ gst_soup_http_src_got_headers_cb (SoupMessage * msg, GstSoupHTTPSrc * src)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (msg->status_code == SOUP_STATUS_UNAUTHORIZED)
|
||||||
|
return;
|
||||||
|
|
||||||
src->session_io_status = GST_SOUP_HTTP_SRC_SESSION_IO_STATUS_RUNNING;
|
src->session_io_status = GST_SOUP_HTTP_SRC_SESSION_IO_STATUS_RUNNING;
|
||||||
|
|
||||||
/* Parse Content-Length. */
|
/* Parse Content-Length. */
|
||||||
@ -723,10 +745,15 @@ gst_soup_http_src_chunk_allocator (SoupMessage * msg, gsize max_len,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GstSoupHTTPSrc *src = (GstSoupHTTPSrc *) user_data;
|
GstSoupHTTPSrc *src = (GstSoupHTTPSrc *) user_data;
|
||||||
|
|
||||||
GstBaseSrc *basesrc = GST_BASE_SRC_CAST (src);
|
GstBaseSrc *basesrc = GST_BASE_SRC_CAST (src);
|
||||||
|
|
||||||
GstBuffer *gstbuf;
|
GstBuffer *gstbuf;
|
||||||
|
|
||||||
SoupBuffer *soupbuf;
|
SoupBuffer *soupbuf;
|
||||||
|
|
||||||
gsize length;
|
gsize length;
|
||||||
|
|
||||||
GstFlowReturn rc;
|
GstFlowReturn rc;
|
||||||
|
|
||||||
if (max_len)
|
if (max_len)
|
||||||
@ -760,6 +787,7 @@ gst_soup_http_src_got_chunk_cb (SoupMessage * msg, SoupBuffer * chunk,
|
|||||||
GstSoupHTTPSrc * src)
|
GstSoupHTTPSrc * src)
|
||||||
{
|
{
|
||||||
GstBaseSrc *basesrc;
|
GstBaseSrc *basesrc;
|
||||||
|
|
||||||
guint64 new_position;
|
guint64 new_position;
|
||||||
|
|
||||||
if (G_UNLIKELY (msg != src->msg)) {
|
if (G_UNLIKELY (msg != src->msg)) {
|
||||||
@ -782,8 +810,9 @@ gst_soup_http_src_got_chunk_cb (SoupMessage * msg, SoupBuffer * chunk,
|
|||||||
GST_BUFFER_OFFSET (*src->outbuf) = basesrc->segment.last_stop;
|
GST_BUFFER_OFFSET (*src->outbuf) = basesrc->segment.last_stop;
|
||||||
|
|
||||||
gst_buffer_set_caps (*src->outbuf,
|
gst_buffer_set_caps (*src->outbuf,
|
||||||
(src->icy_caps) ? src->
|
(src->
|
||||||
icy_caps : GST_PAD_CAPS (GST_BASE_SRC_PAD (basesrc)));
|
icy_caps) ? src->icy_caps :
|
||||||
|
GST_PAD_CAPS (GST_BASE_SRC_PAD (basesrc)));
|
||||||
|
|
||||||
new_position = src->read_position + chunk->length;
|
new_position = src->read_position + chunk->length;
|
||||||
if (G_LIKELY (src->request_position == src->read_position))
|
if (G_LIKELY (src->request_position == src->read_position))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user