Add some more portal plugin debug strings
authorSamuel Ortiz <sameo@linux.intel.com>
Mon, 7 Jun 2010 17:00:04 +0000 (19:00 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 7 Jun 2010 17:03:02 +0000 (19:03 +0200)
plugins/portal.c

index b30ea7a..c937c25 100644 (file)
@@ -167,6 +167,7 @@ static gboolean tcp_event(GIOChannel *channel, GIOCondition condition,
                return FALSE;
 
        if (condition & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) {
+               connman_error("TCP event error %d", condition);
                remove_timeout(data);
                data->watch = 0;
                if (data->get_page)
@@ -257,12 +258,16 @@ static int get_html(struct connman_location *location, int ms_time)
        int ret;
        char *ip = NULL;
 
+       DBG("");
+
        data = connman_location_get_data(location);
        data->connection_ready = 0;
        data->sock = create_socket();
        if (data->sock < 0)
                goto error;
 
+       DBG("proxy %s port %d", data->proxy, data->proxy_port);
+
        if (strlen(data->proxy) > 0)
                ip = get_ip_from_host(data->proxy);
        else {
@@ -341,15 +346,19 @@ static int get_status(struct server_data *data, char *page, int len)
        str = g_strrstr(lines[0], "200 OK");
        if (str != NULL) {
                for (i = 0; lines[i] != NULL && i < 12; i++) {
+                       DBG("%s", lines[i]);
                        str = g_strstr_len(lines[i], 12, "Set-Cookie");
                        if (str != NULL) {
                                g_strfreev(lines);
+                               DBG("success");
                                return GET_PAGE_SUCCESS;
                        }
                }
        }
        g_strfreev(lines);
 
+       DBG("redirection");
+
        return GET_PAGE_REDIRECTED;
 }
 
@@ -366,6 +375,8 @@ static int get_page_cb(struct connman_location *location, char *page, int len,
        else
                ret = status;
 
+       DBG("status %d", status);
+
        switch (ret) {
        case GET_PAGE_SUCCESS:
                connman_location_report_result(location,
@@ -399,6 +410,9 @@ static int location_detect(struct connman_location *location)
        enum connman_service_type service_type;
 
        service_type = connman_location_get_type(location);
+
+       DBG("service type %d", service_type);
+
        switch (service_type) {
        case CONNMAN_SERVICE_TYPE_ETHERNET:
        case CONNMAN_SERVICE_TYPE_WIFI: