gvfs r1740 - in branches/gnome-2-22: . daemon
- From: gicmo svn gnome org
- To: svn-commits-list gnome org
- Subject: gvfs r1740 - in branches/gnome-2-22: . daemon
- Date: Wed, 16 Apr 2008 16:56:36 +0100 (BST)
Author: gicmo
Date: Wed Apr 16 16:56:36 2008
New Revision: 1740
URL: http://svn.gnome.org/viewvc/gvfs?rev=1740&view=rev
Log:
Add debug logging support for http/dav
* daemon/gvfsbackendhttp.c:
Add logging for soup so we can get easy network traces even
if we are doing https.
Modified:
branches/gnome-2-22/ChangeLog
branches/gnome-2-22/daemon/gvfsbackendhttp.c
Modified: branches/gnome-2-22/daemon/gvfsbackendhttp.c
==============================================================================
--- branches/gnome-2-22/daemon/gvfsbackendhttp.c (original)
+++ branches/gnome-2-22/daemon/gvfsbackendhttp.c Wed Apr 16 16:56:36 2008
@@ -75,9 +75,13 @@
(*G_OBJECT_CLASS (g_vfs_backend_http_parent_class)->finalize) (object);
}
+#define DEBUG_MAX_BODY_SIZE (100 * 1024 * 1024)
+
static void
g_vfs_backend_http_init (GVfsBackendHttp *backend)
{
+ const char *debug;
+
g_vfs_backend_set_user_visible (G_VFS_BACKEND (backend), FALSE);
backend->session = soup_session_sync_new_with_options ("user-agent",
@@ -87,6 +91,28 @@
backend->session_async = soup_session_async_new_with_options ("user-agent",
"gvfs/" VERSION,
NULL);
+
+ /* Logging */
+ debug = g_getenv ("GVFS_HTTP_DEBUG");
+ if (debug)
+ {
+ SoupLogger *logger;
+ SoupLoggerLogLevel level;
+
+ if (g_ascii_strcasecmp (debug, "all") ||
+ g_ascii_strcasecmp (debug, "body"))
+ level = SOUP_LOGGER_LOG_BODY;
+ else if (g_ascii_strcasecmp (debug, "header"))
+ level = SOUP_LOGGER_LOG_HEADERS;
+ else
+ level = SOUP_LOGGER_LOG_MINIMAL;
+
+ logger = soup_logger_new (level, DEBUG_MAX_BODY_SIZE);
+ soup_logger_attach (logger, backend->session);
+ soup_logger_attach (logger, backend->session_async);
+ g_object_unref (logger);
+ }
+
}
/* ************************************************************************* */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]