return G_SOURCE_REMOVE;
}
+static void
+schedule_quit_timer (NMVPNPlugin *self)
+{
+ NMVPNPluginPrivate *priv = NM_VPN_PLUGIN_GET_PRIVATE (self);
+
+ nm_clear_g_source (&priv->quit_timer);
+ priv->quit_timer = g_timeout_add_seconds (NM_VPN_PLUGIN_QUIT_TIMER,
+ quit_timer_expired,
+ self);
+}
+
static gboolean
fail_stop (gpointer data)
{
ret = TRUE;
if (needed) {
+ /* Push back the quit timer so the VPN plugin doesn't quit in the
+ * middle of asking the user for secrets.
+ */
+ schedule_quit_timer (plugin);
+
g_assert (sn);
*setting_name = g_strdup (sn);
} else {
nm_clear_g_source (&priv->fail_stop_id);
break;
case NM_VPN_SERVICE_STATE_STOPPED:
- priv->quit_timer = g_timeout_add_seconds (NM_VPN_PLUGIN_QUIT_TIMER,
- quit_timer_expired,
- plugin);
+ schedule_quit_timer (plugin);
break;
default:
/* Clean up all timers we might have set up. */
return G_SOURCE_REMOVE;
}
+static void
+schedule_quit_timer (NMVpnPluginOld *self)
+{
+ NMVpnPluginOldPrivate *priv = NM_VPN_PLUGIN_OLD_GET_PRIVATE (self);
+
+ nm_clear_g_source (&priv->quit_timer);
+ priv->quit_timer = g_timeout_add_seconds (NM_VPN_PLUGIN_OLD_QUIT_TIMER,
+ quit_timer_expired,
+ self);
+}
+
static gboolean
fail_stop (gpointer data)
{
}
if (needed) {
+ /* Push back the quit timer so the VPN plugin doesn't quit in the
+ * middle of asking the user for secrets.
+ */
+ schedule_quit_timer (plugin);
+
g_assert (setting_name);
g_dbus_method_invocation_return_value (context,
g_variant_new ("(s)", setting_name));
nm_clear_g_source (&priv->fail_stop_id);
break;
case NM_VPN_SERVICE_STATE_STOPPED:
- priv->quit_timer = g_timeout_add_seconds (NM_VPN_PLUGIN_OLD_QUIT_TIMER,
- quit_timer_expired,
- plugin);
+ schedule_quit_timer (plugin);
break;
default:
/* Clean up all timers we might have set up. */