From 185957c98b1f6ea0971f2b343e26befa401a0952 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 15 Jun 2009 23:49:48 +0100 Subject: [PATCH] souphttpsrc: log response and request headers and fix some broken indenting --- ext/soup/gstsouphttpsrc.c | 42 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c index ac2007a..00b0541 100644 --- a/ext/soup/gstsouphttpsrc.c +++ b/ext/soup/gstsouphttpsrc.c @@ -138,44 +138,29 @@ static void gst_soup_http_src_get_property (GObject * object, guint prop_id, static GstFlowReturn gst_soup_http_src_create (GstPushSrc * psrc, GstBuffer ** outbuf); static gboolean gst_soup_http_src_start (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_is_seekable (GstBaseSrc * bsrc); - static gboolean gst_soup_http_src_do_seek (GstBaseSrc * bsrc, GstSegment * segment); 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_set_location (GstSoupHTTPSrc * src, const gchar * uri); static gboolean gst_soup_http_src_set_proxy (GstSoupHTTPSrc * src, const gchar * uri); - static char *gst_soup_http_src_unicodify (const char *str); - 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_queue_message (GstSoupHTTPSrc * src); - static gboolean gst_soup_http_src_add_range_header (GstSoupHTTPSrc * src, guint64 offset); 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_close (GstSoupHTTPSrc * src); - static void gst_soup_http_src_parse_status (SoupMessage * msg, GstSoupHTTPSrc * src); static void gst_soup_http_src_chunk_free (gpointer gstbuf); - static SoupBuffer *gst_soup_http_src_chunk_allocator (SoupMessage * msg, gsize max_len, gpointer user_data); static void gst_soup_http_src_got_chunk_cb (SoupMessage * msg, @@ -225,9 +210,7 @@ static void gst_soup_http_src_class_init (GstSoupHTTPSrcClass * klass) { GObjectClass *gobject_class; - GstBaseSrcClass *gstbasesrc_class; - GstPushSrcClass *gstpushsrc_class; gobject_class = (GObjectClass *) klass; @@ -734,19 +717,24 @@ gst_soup_http_src_authenticate_cb (SoupSession * session, SoupMessage * msg, } static void +gst_soup_http_src_headers_foreach (const gchar * name, const gchar * val, + gpointer src) +{ + GST_DEBUG_OBJECT (src, " %s: %s", name, val); +} + +static void gst_soup_http_src_got_headers_cb (SoupMessage * msg, GstSoupHTTPSrc * src) { const char *value; - GstTagList *tag_list; - GstBaseSrc *basesrc; - guint64 newsize; - GHashTable *params = NULL; - GST_DEBUG_OBJECT (src, "got headers"); + GST_DEBUG_OBJECT (src, "got headers:"); + soup_message_headers_foreach (msg->response_headers, + gst_soup_http_src_headers_foreach, src); if (src->automatic_redirect && SOUP_STATUS_IS_REDIRECTION (msg->status_code)) { GST_DEBUG_OBJECT (src, "%u redirect to \"%s\"", msg->status_code, @@ -965,15 +953,10 @@ gst_soup_http_src_chunk_allocator (SoupMessage * msg, gsize max_len, gpointer user_data) { GstSoupHTTPSrc *src = (GstSoupHTTPSrc *) user_data; - GstBaseSrc *basesrc = GST_BASE_SRC_CAST (src); - GstBuffer *gstbuf; - SoupBuffer *soupbuf; - gsize length; - GstFlowReturn rc; if (max_len) @@ -1007,7 +990,6 @@ gst_soup_http_src_got_chunk_cb (SoupMessage * msg, SoupBuffer * chunk, GstSoupHTTPSrc * src) { GstBaseSrc *basesrc; - guint64 new_position; if (G_UNLIKELY (msg != src->msg)) { @@ -1163,6 +1145,10 @@ gst_soup_http_src_build_message (GstSoupHTTPSrc * src) gst_soup_http_src_add_extra_headers (src); + GST_DEBUG_OBJECT (src, "request headers:"); + soup_message_headers_foreach (src->msg->request_headers, + gst_soup_http_src_headers_foreach, src); + return TRUE; } -- 2.7.4