[PATCH] wispr: Handle status codes 505 and 000 by the browser
Sometimes captive portal system might return these status codes when continuing with g_web_request_get after the initial 302 status code. Let the browser handle these cases. 000 is seen with http://www.hotspotsystem.com/ 505 is seen with http://nextmesh.net/ Special thanks to Lorn Potter. Signed-off-by: Pasi Sjöholm --- src/wispr.c | 12 1 file changed, 12 insertions(+) diff --git a/src/wispr.c b/src/wispr.c index dcce93c..4b60c69 100644 --- a/src/wispr.c +++ b/src/wispr.c @@ -711,6 +711,12 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data) DBG("status: %03u", status); switch (status) { + case 000: + DBG("Status code 000 (proxy?), handling over to the browser"); + __connman_agent_request_browser(wp_context->service, + wispr_portal_browser_reply_cb, + wp_context->status_url, wp_context); + break; case 200: if (wp_context->wispr_msg.message_type >= 0) break; @@ -755,6 +761,12 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data) } break; + case 505: + DBG("HTTP version not supported, hand over to the browser"); + __connman_agent_request_browser(wp_context->service, + wispr_portal_browser_reply_cb, + wp_context->status_url, wp_context); + break; default: break; } -- 1.9.1 ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
[PATCH] wispr: Handle status codes 505 and 000 by the browser
Sometimes captive portal system might return these status codes when continuing with g_web_request_get after the initial 302 status code. Let the browser handle these cases. 000 is seen with http://www.hotspotsystem.com/ 505 is seen with http://nextmesh.net/ Special thanks to Lorn Potter. --- src/wispr.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/wispr.c b/src/wispr.c index dcce93c..c4fcd60 100644 --- a/src/wispr.c +++ b/src/wispr.c @@ -711,6 +711,11 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data) DBG("status: %03u", status); switch (status) { + case 000: + __connman_agent_request_browser(wp_context->service, + wispr_portal_browser_reply_cb, + wp_context->status_url, wp_context); + break; case 200: if (wp_context->wispr_msg.message_type >= 0) break; @@ -755,6 +760,11 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data) } break; + case 505: + __connman_agent_request_browser(wp_context->service, + wispr_portal_browser_reply_cb, + wp_context->status_url, wp_context); + break; default: break; } -- 1.9.1 ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] wispr: Handle status codes 505 and 000 by the browser
Hi Pasi, Minor comments, Sometimes captive portal system might return these status codes when continuing with g_web_request_get after the initial 302 status code. Let the browser handle these cases. 000 is seen with http://www.hotspotsystem.com/ 505 is seen with http://nextmesh.net/ Special thanks to Lorn Potter. Signed-off-by: Pasi Sjöholm We don't use signed-off in connman ;) --- src/wispr.c | 12 1 file changed, 12 insertions(+) diff --git a/src/wispr.c b/src/wispr.c index dcce93c..4b60c69 100644 --- a/src/wispr.c +++ b/src/wispr.c @@ -711,6 +711,12 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data) DBG("status: %03u", status); switch (status) { + case 000: + DBG("Status code 000 (proxy?), handling over to the browser"); No need of this debug message (the status is already printed above) + __connman_agent_request_browser(wp_context->service, + wispr_portal_browser_reply_cb, + wp_context->status_url, wp_context); + break; case 200: if (wp_context->wispr_msg.message_type >= 0) break; @@ -755,6 +761,12 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data) } break; + case 505: + DBG("HTTP version not supported, hand over to the browser"); Same here. Anyway, though handling this status 505 like you propose is fine, it would be great to know what/where/how made this status to fix gweb then (if there is something to be fixed there). + __connman_agent_request_browser(wp_context->service, + wispr_portal_browser_reply_cb, + wp_context->status_url, wp_context); + break; default: break; } Tomasz ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
RE: [PATCH] wispr: Handle status codes 505 and 000 by the browser
Hi Tomasz, >> + case 505: >> + DBG("HTTP version not supported, hand over to the browser"); >Anyway, though handling this status 505 like you propose is fine, it >would be great to know what/where/how made this status to fix gweb then >(if there is something to be fixed there). I need to have a decent debug session with that particular hotspot-environment but there is something weird as querying with the curl causes the same response if querying the redirection url directly, but if doing "curl -L" for the connman status-url (http://ipv4..) it will get to the portal sign in-page by going the full-path within the "same session". I will re-send the patch without signed-off and DBG's. Br, Pasi ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] wispr: Handle status codes 505 and 000 by the browser
Thanks Pasi, ACK from me. Tomasz ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] wispr: Handle status codes 505 and 000 by the browser
Hi Pasi, + case 505: >>+ DBG("HTTP version not supported, hand over to the browser"); >Anyway, though handling this status 505 like you propose is fine, it >would be great to know what/where/how made this status to fix gweb then >(if there is something to be fixed there). I need to have a decent debug session with that particular hotspot-environment but there is something weird as querying with the curl causes the same response if querying the redirection url directly, but if doing "curl -L" for the connman status-url (http://ipv4..) it will get to the portal sign in-page by going the full-path within the "same session". If you can get such debug session that would be nice, no hurry though: from your testing with curl we can conclude already some interesting information. I'll check gweb code later on, there is probably an issue with how it keeps the session opened. Tomasz ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] wispr: Handle status codes 505 and 000 by the browser
Hi Pasi, On 07/01/2014 03:43 PM, Pasi Sjöholm wrote: > Sometimes captive portal system might return these status codes > when continuing with g_web_request_get after the initial 302 status > code. Let the browser handle these cases. > > 000 is seen with http://www.hotspotsystem.com/ > 505 is seen with http://nextmesh.net/ > > Special thanks to Lorn Potter. Patch applied. Thanks for your contribution. Unfortunately this patch was whitespace damaged. I needed to fix up the spaces vs tabs issue. Please make sure next time you use tabs. cheers, Daniel ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman