[network-manager-openvpn/th/cleanup: 8/11] service: log a debug message on connect()



commit d4bf39c78914af8fdbbff93ffe36a9806e8979d9
Author: Thomas Haller <thaller redhat com>
Date:   Fri Nov 17 16:56:31 2017 +0100

    service: log a debug message on connect()
    
    I want to see whether the server calls interactive connect.

 src/nm-openvpn-service.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c
index 78cd9cf..8f41f12 100644
--- a/src/nm-openvpn-service.c
+++ b/src/nm-openvpn-service.c
@@ -1994,13 +1994,18 @@ real_disconnect (NMVpnServicePlugin *plugin,
 }
 
 static gboolean
-_connect_common (NMVpnServicePlugin   *plugin,
-                 NMConnection  *connection,
-                 GVariant      *details,
-                 GError       **error)
+_connect_common (NMVpnServicePlugin *plugin,
+                 NMConnection *connection,
+                 gboolean interactive,
+                 GVariant *details,
+                 GError **error)
 {
        GError *local = NULL;
 
+       NM_OPENVPN_PLUGIN_GET_PRIVATE (plugin)->interactive = interactive;
+
+       _LOGD ("connect (interactive=%d)", interactive);
+
        if (!real_disconnect (plugin, &local)) {
                _LOGW ("Could not clean up previous daemon run: %s", local->message);
                g_error_free (local);
@@ -2016,7 +2021,7 @@ real_connect (NMVpnServicePlugin   *plugin,
               NMConnection  *connection,
               GError       **error)
 {
-       return _connect_common (plugin, connection, NULL, error);
+       return _connect_common (plugin, connection, FALSE, NULL, error);
 }
 
 static gboolean
@@ -2025,11 +2030,7 @@ real_connect_interactive (NMVpnServicePlugin   *plugin,
                           GVariant      *details,
                           GError       **error)
 {
-       if (!_connect_common (plugin, connection, details, error))
-               return FALSE;
-
-       NM_OPENVPN_PLUGIN_GET_PRIVATE (plugin)->interactive = TRUE;
-       return TRUE;
+       return _connect_common (plugin, connection, TRUE, details, error);
 }
 
 static gboolean


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