From: Samuel Ortiz Date: Mon, 7 Jun 2010 17:00:04 +0000 (+0200) Subject: Add some more portal plugin debug strings X-Git-Tag: 2.0_alpha~2717 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0394ef444535bb2c5551dfb33dfb6673ef7dd740;p=framework%2Fconnectivity%2Fconnman.git Add some more portal plugin debug strings --- diff --git a/plugins/portal.c b/plugins/portal.c index b30ea7a..c937c25 100644 --- a/plugins/portal.c +++ b/plugins/portal.c @@ -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: