[X2Go-Commits] [libx2goclient] 36/44: src/test/sshtest.c: only try to connect again if the first connection succeeded.
git-admin at x2go.org
git-admin at x2go.org
Fri Sep 18 01:55:39 CEST 2020
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository libx2goclient.
commit 9ba06519e055dc9552182985e68bbbcc21e9370a
Author: Mihai Moldovan <ionic at ionic.de>
Date: Thu Sep 17 10:58:28 2020 +0200
src/test/sshtest.c: only try to connect again if the first connection succeeded.
---
src/test/sshtest.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/test/sshtest.c b/src/test/sshtest.c
index f8fc78a..1a3294f 100644
--- a/src/test/sshtest.c
+++ b/src/test/sshtest.c
@@ -108,13 +108,15 @@ int main (const int argc, const char * const * const argv) {
g_object_get (G_OBJECT (net_ssh), "connected", &conn_ret, NULL);
g_printf ("Current connection status (via getter): %d\n", (int) (conn_ret));
- /* Connect again, shouldn't cause anything to change. */
- g_printf ("Trying to connect again...\n");
- conn_ret = x2goclient_network_ssh_connect (net_ssh, NULL);
- g_printf ("Connection status: %s.\n", (conn_ret) ? "true" : "false");
-
- /* Let ssh connection live for a few seconds, give or take. */
- sleep (30);
+ if (conn_ret) {
+ /* Connect again, shouldn't cause anything to change. */
+ g_printf ("Trying to connect again...\n");
+ conn_ret = x2goclient_network_ssh_connect (net_ssh, NULL);
+ g_printf ("Connection status: %s.\n", (conn_ret) ? "true" : "false");
+
+ /* Let ssh connection live for a few seconds, give or take. */
+ sleep (30);
+ }
g_clear_object (&net_ssh);
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
More information about the x2go-commits
mailing list