~lemonboy/capnet-assist/check-network-connectivity

« back to all changes in this revision

Viewing changes to src/CaptiveLogin.vala

  • Committer: LemonBoy
  • Date: 2015-10-21 12:51:28 UTC
  • Revision ID: thatlemon@gmail.com-20151021125128-qwnwll8ispm3vlqu
Make sure the network is available before checking for connectivity.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    }
53
53
    
54
54
    public bool isLoggedIn () {
 
55
        var network_monitor = NetworkMonitor.get_default ();
 
56
 
 
57
        // No connection is available at the moment, don't bother trying the
 
58
        // connectivity check
 
59
        if (!network_monitor.get_network_available ()) {
 
60
            return true;
 
61
        }
 
62
 
55
63
        var page = "http://connectivitycheck.android.com/generate_204";
56
64
        debug ("Getting 204 page");
57
65