Unfortunately there are numerous of ISP's or organizations which
want to modify/strip X-ConnMan-Status-header away from the
http-responses even the connection is otherwise just fine (eg. no
portals). However they do not modify http-status response codes and
that's when the "204" comes in handy. With this patch ConnMan-users
can use alternative way to check whether their devices are
actually "online"
---
 src/main.conf | 5 +++--
 src/wispr.c   | 5 +++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/main.conf b/src/main.conf
index 0247d0f..0c6720e 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -96,7 +96,8 @@
 # Default value is false.
 # PersistentTetheringMode = false
 
-# Set the online status url which returns at least "X-ConnMan-Status: 
-# online" HTTP-header.
+# Set the online status url which either returns at least 
+# "X-ConnMan-Status: online" HTTP-header or HTTP-status 
+# code 204.
 Ipv4StatusUrl = http://ipv4.connman.net/online/status.html
 Ipv6StatusUrl = http://ipv6.connman.net/online/status.html
diff --git a/src/wispr.c b/src/wispr.c
index 4ba2b28..5e8912f 100644
--- a/src/wispr.c
+++ b/src/wispr.c
@@ -257,6 +257,8 @@ static const char *response_code_to_string(int 
response_code)
                return "Proxy detection/repeat operation";
        case 201:
                return "Authentication pending";
+       case 204:
+               return "Walled garden check";
        case 255:
                return "Access gateway internal error";
        }
@@ -722,6 +724,9 @@ static bool wispr_portal_web_result(GWebResult *result, 
gpointer user_data)
                                        wp_context->redirect_url, wp_context);
 
                break;
+       case 204:
+               portal_manage_status(result, wp_context);
+               return false;
        case 302:
                if (!g_web_supports_tls() ||
                        !g_web_result_get_header(result, "Location",
-- 
1.8.3.2

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to