summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-04-05 12:04:06 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-04-05 15:22:45 +0300
commita5193d7360e081436a21da3991b6eb268a8da42e (patch)
tree2855bc36acf89ae693fb8028f139dc809a4944cf
parentd803fbaf4ef630a63383449535af68440133e823 (diff)
downloadconnman-a5193d7360e081436a21da3991b6eb268a8da42e.tar.gz
connman-a5193d7360e081436a21da3991b6eb268a8da42e.tar.bz2
connman-a5193d7360e081436a21da3991b6eb268a8da42e.zip
6to4: Add web debug prints
In order to see what is the problem with web connection, add debug print function.
-rw-r--r--src/6to4.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/6to4.c b/src/6to4.c
index 41b2dc95..802a1dfc 100644
--- a/src/6to4.c
+++ b/src/6to4.c
@@ -26,6 +26,7 @@
#include <errno.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -250,6 +251,11 @@ static gboolean web_result(GWebResult *result, gpointer user_data)
return FALSE;
}
+static void web_debug(const char *str, void *data)
+{
+ connman_info("%s: %s\n", (const char *) data, str);
+}
+
static int init_6to4(struct in_addr *ip4addr)
{
unsigned int a, b, c, d;
@@ -297,6 +303,9 @@ static int init_6to4(struct in_addr *ip4addr)
g_web_set_user_agent(web, "ConnMan/%s", VERSION);
g_web_set_close_connection(web, TRUE);
+ if (getenv("CONNMAN_WEB_DEBUG"))
+ g_web_set_debug(web, web_debug, "6to4");
+
web_request_id = g_web_request_get(web, STATUS_URL, web_result, NULL);
return 0;