summaryrefslogtreecommitdiff
path: root/vpn
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2012-12-14 11:01:18 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-12-14 14:16:10 (GMT)
commit635e902a6667d6fafd66d5e027d993b8bc31ab55 (patch)
treefa4f00785cd2574fe42f443c4934e273a62083f2 /vpn
parent61812a36b5553a0630d90892de5b0192667fa988 (diff)
downloadconnman-635e902a6667d6fafd66d5e027d993b8bc31ab55.zip
connman-635e902a6667d6fafd66d5e027d993b8bc31ab55.tar.gz
connman-635e902a6667d6fafd66d5e027d993b8bc31ab55.tar.bz2
vpn-provider: Set state when connecting and disconnecting
Update provider state when connect or disconnect is initiated.
Diffstat (limited to 'vpn')
-rw-r--r--vpn/vpn-provider.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c
index 0b164c0..e98573f 100644
--- a/vpn/vpn-provider.c
+++ b/vpn/vpn-provider.c
@@ -966,14 +966,10 @@ int __vpn_provider_disconnect(struct vpn_provider *provider)
else
return -EOPNOTSUPP;
- if (err < 0) {
- if (err != -EINPROGRESS)
- return err;
-
- return -EINPROGRESS;
- }
+ if (err == -EINPROGRESS)
+ vpn_provider_set_state(provider, VPN_PROVIDER_STATE_CONNECT);
- return 0;
+ return err;
}
static void connect_cb(struct vpn_provider *provider, void *user_data,
@@ -1009,6 +1005,9 @@ int __vpn_provider_connect(struct vpn_provider *provider, DBusMessage *msg)
} else
return -EOPNOTSUPP;
+ if (err == -EINPROGRESS)
+ vpn_provider_set_state(provider, VPN_PROVIDER_STATE_CONNECT);
+
return err;
}