mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 14:00:15 +01:00
libnm/vpn-service-plugin: quit when the peer we watch disconnects
We're of no use anymore as another user would start an instance with a different bus name.
This commit is contained in:
parent
9f15abbda7
commit
78f263a5fd
1 changed files with 9 additions and 6 deletions
|
|
@ -212,11 +212,6 @@ nm_vpn_service_plugin_disconnect (NMVpnServicePlugin *plugin, GError **err)
|
|||
break;
|
||||
case NM_VPN_SERVICE_STATE_STARTING:
|
||||
case NM_VPN_SERVICE_STATE_STARTED:
|
||||
if (priv->peer_watch_id) {
|
||||
g_dbus_connection_signal_unsubscribe (nm_vpn_service_plugin_get_connection (plugin),
|
||||
priv->peer_watch_id);
|
||||
priv->peer_watch_id = 0;
|
||||
}
|
||||
nm_vpn_service_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STOPPING);
|
||||
ret = NM_VPN_SERVICE_PLUGIN_GET_CLASS (plugin)->disconnect (plugin, err);
|
||||
nm_vpn_service_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STOPPED);
|
||||
|
|
@ -1128,7 +1123,15 @@ state_changed (NMVpnServicePlugin *plugin, NMVpnServiceState state)
|
|||
nm_clear_g_source (&priv->fail_stop_id);
|
||||
break;
|
||||
case NM_VPN_SERVICE_STATE_STOPPED:
|
||||
schedule_quit_timer (plugin);
|
||||
if (priv->dbus_watch_peer)
|
||||
nm_vpn_service_plugin_emit_quit (plugin);
|
||||
else
|
||||
schedule_quit_timer (plugin);
|
||||
if (priv->peer_watch_id) {
|
||||
g_dbus_connection_signal_unsubscribe (nm_vpn_service_plugin_get_connection (plugin),
|
||||
priv->peer_watch_id);
|
||||
priv->peer_watch_id = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* Clean up all timers we might have set up. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue