[network-manager-pptp] service: drop use of API that's gone



commit 6031c284898e1ee82a7041e2c86d2037b015bd9e
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Tue Oct 13 18:34:33 2015 +0200

    service: drop use of API that's gone
    
    The NM 1.2 snapshot just removed it and does the status transitions on
    _failure() and _disconnect().

 src/nm-pptp-service.c |   18 +++---------------
 1 files changed, 3 insertions(+), 15 deletions(-)
---
diff --git a/src/nm-pptp-service.c b/src/nm-pptp-service.c
index 494e27e..8b0eeb6 100644
--- a/src/nm-pptp-service.c
+++ b/src/nm-pptp-service.c
@@ -759,10 +759,9 @@ pppd_watch_cb (GPid pid, gint status, gpointer user_data)
                nm_vpn_service_plugin_failure (NM_VPN_SERVICE_PLUGIN (plugin), 
NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED);
                break;
        default:
+               nm_vpn_service_plugin_disconnect (NM_VPN_SERVICE_PLUGIN (plugin), NULL);
                break;
        }
-
-       nm_vpn_service_plugin_set_state (NM_VPN_SERVICE_PLUGIN (plugin), NM_VPN_SERVICE_STATE_STOPPED);
 }
 
 static inline const char *
@@ -1093,19 +1092,8 @@ service_ppp_state_cb (NMPptpPppService *service,
                       guint32 ppp_state,
                       NMPptpPlugin *plugin)
 {
-       NMVpnServiceState plugin_state = nm_vpn_service_plugin_get_state (NM_VPN_SERVICE_PLUGIN (plugin));
-
-       switch (ppp_state) {
-       case NM_PPP_STATUS_DEAD:
-       case NM_PPP_STATUS_DISCONNECT:
-               if (plugin_state == NM_VPN_SERVICE_STATE_STARTED)
-                       nm_vpn_service_plugin_disconnect (NM_VPN_SERVICE_PLUGIN (plugin), NULL);
-               else if (plugin_state == NM_VPN_SERVICE_STATE_STARTING)
-                       nm_vpn_service_plugin_failure (NM_VPN_SERVICE_PLUGIN (plugin), 
NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED);
-               break;
-       default:
-               break;
-       }
+       if (ppp_state == NM_PPP_STATUS_DEAD || ppp_state == NM_PPP_STATUS_DISCONNECT)
+               nm_vpn_service_plugin_disconnect (NM_VPN_SERVICE_PLUGIN (plugin), NULL);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]