[X2Go-Commits] [libx2goclient] 02/02: src/x2goclient-utils.c: truncation size in x2goclient_strbrk_dup () should not be further decremented.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 21aaac171e1168241c951ff68ccc964e3ce66751 Author: Mihai Moldovan Date: Fri Sep 18 02:55:07 2020 +0200 src/x2goclient-utils.c: truncation size in x2goclient_strbrk_dup () should not be further decremented. The needle position actually is the remaining string size, so don't decrement it again. --- src/x2goclient-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index 6ee33c6..6ef4c1e 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -209,7 +209,7 @@ gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char need /* Since needle was found, the difference must be at least one. */ g_assert (needle_pos - *haystack); -gsize truncate_size = ((needle_pos - *haystack) - 1); +gsize truncate_size = (needle_pos - *haystack); /* Don't copy the needle. */ ret = g_strndup (*haystack, truncate_size); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 01/02: src/x2goclient-utils.c: whitespace in function declaration only.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 1e673c09cb97b3ca04b9c58ca7dc65640e8fdad3 Author: Mihai Moldovan Date: Fri Sep 18 02:48:22 2020 +0200 src/x2goclient-utils.c: whitespace in function declaration only. --- src/x2goclient-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index d1ac734..6ee33c6 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -193,7 +193,7 @@ long long x2goclient_str_to_int (const gchar * const restrict str, const _Bool m * original string) if @needle was not found, unless an error * occurred */ -gchar* x2goclient_strbrk_dup (gchar *restrict * const haystack, const char needle, const _Bool free_orig, gsize * const new_size) { +gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char needle, const _Bool free_orig, gsize * const new_size) { gchar *ret = NULL; g_return_val_if_fail (((NULL != haystack) && (NULL != *haystack)), ret); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] branch master updated (8491443 -> 21aaac1)
This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository libx2goclient. from 8491443 src/x2goclient-network-ssh.c: add debugging output for check thread main function. new 1e673c0 src/x2goclient-utils.c: whitespace in function declaration only. new 21aaac1 src/x2goclient-utils.c: truncation size in x2goclient_strbrk_dup () should not be further decremented. The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: src/x2goclient-utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 23/44: src/test/sshtest.c: try to connect a second time to see if the function is really idempotent now.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 007bfa828a6b0c1fd60ea513a908450783698628 Author: Mihai Moldovan Date: Mon Aug 3 12:49:45 2020 +0200 src/test/sshtest.c: try to connect a second time to see if the function is really idempotent now. --- src/test/sshtest.c | 8 1 file changed, 8 insertions(+) diff --git a/src/test/sshtest.c b/src/test/sshtest.c index fca6bf5..07e9ff6 100644 --- a/src/test/sshtest.c +++ b/src/test/sshtest.c @@ -100,9 +100,17 @@ int main (const int argc, const char * const * const argv) { g_object_get (G_OBJECT (net_ssh), "connected", _ret, NULL); g_printf ("Current connection status (again): %d\n", (int) (conn_ret)); + /* Actually connect. */ g_printf ("Trying to connect...\n"); conn_ret = x2goclient_network_ssh_connect (net_ssh, NULL); g_printf ("Connection status: %s.\n", (conn_ret) ? "true" : "false"); + g_object_get (G_OBJECT (net_ssh), "connected", _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"); g_clear_object (_ssh); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 20/44: src/x2goclient-network.{c, h}: add new private parent_connect function pointer, to be used for x2goclient_network_connect ().
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit ca3938f5b06c0b21760c10d9ceae6cfec32402b9 Author: Mihai Moldovan Date: Mon Aug 3 12:45:37 2020 +0200 src/x2goclient-network.{c,h}: add new private parent_connect function pointer, to be used for x2goclient_network_connect (). --- src/x2goclient-network.c | 2 ++ src/x2goclient-network.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 811d6e9..83f51b1 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -130,6 +130,8 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) G_PARAM_STATIC_STRINGS | G_PARAM_READABLE); g_object_class_install_properties (object_class, X2GO_NET_N_PROPERTIES, net_obj_properties); + + klass->parent_connect = _network_connect; } static void x2goclient_network_init (X2GoClientNetwork * const self) { diff --git a/src/x2goclient-network.h b/src/x2goclient-network.h index cf96c35..5e0c15d 100644 --- a/src/x2goclient-network.h +++ b/src/x2goclient-network.h @@ -59,6 +59,7 @@ struct _X2GoClientNetworkClass { /*< private >*/ GSocketAddress* (*parse_sockspec) (X2GoClientNetwork * const self, const GString * const sockspec); + gboolean (*parent_connect) (X2GoClientNetwork * const self, GError ** const gerr); /* We might need a lot more functions... */ gpointer padding[50]; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 44/44: src/x2goclient-network-ssh.c: add debugging output for check thread main function.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 849144365bdb3d36ee246757e0bfe0c8572c5200 Author: Mihai Moldovan Date: Fri Sep 18 01:45:40 2020 +0200 src/x2goclient-network-ssh.c: add debugging output for check thread main function. --- src/x2goclient-network-ssh.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 607c41e..d130cac 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1469,9 +1469,12 @@ static gpointer x2goclient_network_ssh_check_timeout_thread_main (const gpointer g_main_context_push_thread_default (self->check_thread_context); g_mutex_unlock (&(self->check_thread_mutex)); + g_log (NULL, G_LOG_LEVEL_DEBUG, "Starting main loop in main function in check timeout thread."); /* Execute main loop. */ g_main_loop_run (self->check_thread_loop); + g_log (NULL, G_LOG_LEVEL_DEBUG, "Main loop of check timeout thread terminated."); + g_mutex_lock (&(self->check_thread_mutex)); /* Clean up everything after g_main_loop_run () returned. */ g_main_loop_unref (self->check_thread_loop); @@ -1485,6 +1488,8 @@ static gpointer x2goclient_network_ssh_check_timeout_thread_main (const gpointer self->check_thread_context = NULL; g_mutex_unlock (&(self->check_thread_mutex)); + g_log (NULL, G_LOG_LEVEL_DEBUG, "Terminating main function of check timeout thread."); + return (ret); } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 34/44: src/x2goclient-network-ssh.c: check timeout is not an idle source, rename unwrapping function to x2goclient_network_ssh_start_check_timeout_unwrap.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 1a1e7d0ed0ded0580c36e462f6e0ae6a0960163f Author: Mihai Moldovan Date: Wed Sep 16 05:42:12 2020 +0200 src/x2goclient-network-ssh.c: check timeout is not an idle source, rename unwrapping function to x2goclient_network_ssh_start_check_timeout_unwrap. --- src/x2goclient-network-ssh.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index eb6d3fd..9eb96ae 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -162,7 +162,7 @@ static void x2goclient_network_ssh_check_timeout_data_free (struct x2goclient_ne static gpointer x2goclient_network_ssh_check_timeout_thread_main (const gpointer user_data); static gboolean x2goclient_network_ssh_start_check_timeout (X2GoClientNetworkSSH * const self, GError ** const gerr); static void x2goclient_network_ssh_start_check_timeout_invoke (X2GoClientNetworkSSH * const self, GError ** const gerr); -static gboolean x2goclient_network_ssh_start_check_timeout_idle_unwrap (const gpointer user_data); +static gboolean x2goclient_network_ssh_start_check_timeout_unwrap (const gpointer user_data); static gboolean x2goclient_network_ssh_start_check_timeout_real (X2GoClientNetworkSSH * const self, GError ** const gerr); static gboolean x2goclient_network_ssh_check_timeout (const gpointer self); @@ -1488,11 +1488,11 @@ static void x2goclient_network_ssh_start_check_timeout_invoke (X2GoClientNetwork data->gerr = gerr; g_main_context_invoke_full (self->check_thread_context, G_PRIORITY_DEFAULT, - _network_ssh_start_check_timeout_idle_unwrap, + _network_ssh_start_check_timeout_unwrap, data, (GDestroyNotify) x2goclient_network_ssh_check_timeout_data_free); } -static gboolean x2goclient_network_ssh_start_check_timeout_idle_unwrap (const gpointer user_data) { +static gboolean x2goclient_network_ssh_start_check_timeout_unwrap (const gpointer user_data) { gboolean ret = G_SOURCE_CONTINUE; const struct x2goclient_network_ssh_check_timeout_data *data = user_data; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 36/44: src/test/sshtest.c: only try to connect again if the first connection succeeded.
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 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", _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 (_ssh); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 37/44: src/x2goclient-openssh-bugs.c: bump version requirement for stderr closing to 8.5+.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 108c6b480b172d2c9971fa5a1c51e98b2bb94b60 Author: Mihai Moldovan Date: Thu Sep 17 11:06:42 2020 +0200 src/x2goclient-openssh-bugs.c: bump version requirement for stderr closing to 8.5+. --- src/x2goclient-openssh-bugs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-openssh-bugs.c b/src/x2goclient-openssh-bugs.c index 1c7fa45..da59144 100644 --- a/src/x2goclient-openssh-bugs.c +++ b/src/x2goclient-openssh-bugs.c @@ -73,7 +73,7 @@ gboolean x2goclient_openssh_bugs_update (X2GoClientOpenSSHBugs * const self, con *self = (const X2GoClientOpenSSHBugs) { 0 }; if (8 >= version->major) { -if (2 >= version->minor) { +if (4 >= version->minor) { self->backgrounding_keeps_stderr = TRUE; } } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 11/44: src/x2goclient-network-ssh.{c, h}: split out OpenSSH client process spawning into a separate function called x2goclient_network_ssh_start_sshcmd ().
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit d8ec4e0cc640252144d7c5444340374623d0e50f Author: Mihai Moldovan Date: Thu Jul 30 14:39:48 2020 +0200 src/x2goclient-network-ssh.{c,h}: split out OpenSSH client process spawning into a separate function called x2goclient_network_ssh_start_sshcmd (). This is in preparation of spawning other OpenSSH client processes (like control processes for the master connection), so it's not a straight copy, but something more sophisticated. Also, the code is being reworked to not use an instance variable for the process but to keep it local, since we're in the process of changing this as well. --- src/x2goclient-network-ssh.c | 187 +-- src/x2goclient-network-ssh.h | 2 + 2 files changed, 130 insertions(+), 59 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 7344546..48a75a4 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -137,6 +137,7 @@ static void x2goclient_network_ssh_log_std_str (const gchar * const str, const g static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const arr, const gchar * const prelude, gchar ** const ret_str); static void x2goclient_network_ssh_gptrarray_print_debug (GPtrArray * const arr, const gchar * const prelude, const gchar * const desc); static gboolean x2goclient_network_ssh_sshcmd_add_host_port (X2GoClientNetworkSSH * const self, GPtrArray * const ssh_cmd, GError ** const gerr); +static gboolean x2goclient_network_ssh_start_sshcmd (X2GoClientNetworkSSH * const self, const GPtrArray * const ssh_cmd, GError ** const gerr, const gboolean master); static void x2goclient_network_ssh_class_init (X2GoClientNetworkSSHClass * const klass) { @@ -874,65 +875,7 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const x2goclient_network_ssh_gptrarray_print_debug (ssh_cmd, "Would try to connect via:", "OpenSSH client command"); g_log (NULL, G_LOG_LEVEL_DEBUG, "Launching!"); -GError *ssh_err = NULL; -GSubprocessFlags flags = G_SUBPROCESS_FLAGS_STDOUT_PIPE; - -if (self->openssh_bugs->backgrounding_keeps_stderr) { - flags |= G_SUBPROCESS_FLAGS_STDERR_SILENCE; -} -else { - flags |= G_SUBPROCESS_FLAGS_STDERR_PIPE; -} - -self->master_conn = g_subprocess_newv ((const gchar* const*)(ssh_cmd->pdata), flags, _err); - -ret = (self->master_conn != NULL); - -if (ret) { - g_log (NULL, G_LOG_LEVEL_DEBUG, "Process started/executed successfully!"); - - if (ssh_err) { -g_log (NULL, G_LOG_LEVEL_WARNING, "Successful execution, but ssh_err set? Weird, here's the message: %s", ssh_err->message); - } - - GCancellable *master_conn_comm_cancel = g_cancellable_new (); - g_clear_error (_err); - GBytes *ssh_stdout = NULL, *ssh_stderr = NULL; - if (!(g_subprocess_communicate (self->master_conn, NULL, master_conn_comm_cancel, _stdout, _stderr, _err))) { -g_log (NULL, G_LOG_LEVEL_CRITICAL, "Communication with master connection subprocess failed: %s", ssh_err->message); - } - else { -gsize ssh_stdout_size = 0, ssh_stderr_size = 0; - -const gchar *ssh_stdout_str = NULL, *ssh_stderr_str = NULL; -if (ssh_stdout) { - ssh_stdout_str = g_bytes_get_data (ssh_stdout, _stdout_size); -} -else { - g_log (NULL, G_LOG_LEVEL_WARNING, "Master connection does not have stdout pipe attached, but we expect it to be available. Ignoring output on stdout."); -} - -if (ssh_stderr) { - ssh_stderr_str = g_bytes_get_data (ssh_stderr, _stderr_size); -} -else if (!(self->openssh_bugs->backgrounding_keeps_stderr)) { - g_log (NULL, G_LOG_LEVEL_WARNING, "Master connection does not have stderr pipe attached, but we expect it to be available. Ignoring output on stderr."); -} - -x2goclient_network_ssh_log_std_str (ssh_stdout_str, ssh_stdout_size, 0); -x2goclient_network_ssh_log_std_str (ssh_stderr_str, ssh_stderr_size, 1); - -g_bytes_unref (ssh_stdout); -g_bytes_unref (ssh_stderr); - } - - g_clear_error (_err); -} -else { - g_log (NULL, G_LOG_LEVEL_CRITICAL, "Process didn't execute/start successfully!\nError:\n>>>%s<<<", ssh_err->message); -} - -g_clear_error (_err); +self->active_master_conn = ret = x2goclient_network_ssh_start_sshcmd (self, ssh_cmd, gerr, TRUE); } g_free (session_path); @@ -1283,3 +1226,129 @@ static gboolean x2goclient_network_ssh_sshcmd_add_host_port (X2GoClientNetworkSS return (ret); } + +static gboolean x2goclient_network_ssh_start_sshcmd (X2GoClientNetworkSSH * const self, const GPtrArray * const ssh_cmd, GError ** const gerr, const gboolean master) { +
[X2Go-Commits] [libx2goclient] 15/44: src/x2goclient-network-ssh.c: re-order finalization.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 285eeb3dc232745bc775e10fc26dc8f2b5b11588 Author: Mihai Moldovan Date: Fri Jul 31 11:19:53 2020 +0200 src/x2goclient-network-ssh.c: re-order finalization. Destruction is a delicate matter and we actually have things depend on each other now, so make sure that we get rid of data in the correct order, which also means destroying properties last. --- src/x2goclient-network-ssh.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 6e85e16..e639bd8 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -212,6 +212,21 @@ static void x2goclient_network_ssh_dispose (GObject * const object) { static void x2goclient_network_ssh_finalize (GObject * const object) { X2GoClientNetworkSSH *self = X2GOCLIENT_NETWORK_SSH (object); + /* + * The order of finalization is pretty important. + * + * We'll need data such as the session path for termination of the master + * connection, so make sure that the dependencies are set up correctly here. + */ + + if (!(x2goclient_network_ssh_kill_subprocesses (self))) { +g_log (NULL, G_LOG_LEVEL_CRITICAL, "Some subprocesses were not terminated correctly!"); + } + + g_free (self->control_path); + self->control_path = NULL; + + /* Properties. */ if (self->openssh_version) { g_boxed_free (X2GOCLIENT_TYPE_OPENSSH_VERSION, self->openssh_version); @@ -223,14 +238,6 @@ static void x2goclient_network_ssh_finalize (GObject * const object) { self->openssh_bugs = NULL; } - - g_free (self->control_path); - self->control_path = NULL; - - if (!(x2goclient_network_ssh_kill_subprocesses (self))) { -g_log (NULL, G_LOG_LEVEL_CRITICAL, "Some subprocesses were not terminated correctly!"); - } - (G_OBJECT_CLASS (x2goclient_network_ssh_parent_class))->finalize (object); } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 30/44: src/x2goclient-network-ssh.c: fix typo in debug message.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 115cda27322e6a335af016eac924e7dd9119c79c Author: Mihai Moldovan Date: Mon Sep 7 23:46:54 2020 +0200 src/x2goclient-network-ssh.c: fix typo in debug message. --- src/x2goclient-network-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index c67b67e..dff177d 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1558,7 +1558,7 @@ static gboolean x2goclient_network_ssh_check_timeout (const gpointer data) { g_ptr_array_add (ssh_cmd, NULL); /* Okay, execute. */ -x2goclient_network_ssh_gptrarray_print_debug (ssh_cmd, "Checking master connection statuus via:", "OpenSSH client command"); +x2goclient_network_ssh_gptrarray_print_debug (ssh_cmd, "Checking master connection status via:", "OpenSSH client command"); g_log (NULL, G_LOG_LEVEL_DEBUG, "Launching!"); ret = x2goclient_network_ssh_start_sshcmd (self, ssh_cmd, NULL, FALSE); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 05/44: src/x2goclient-network-ssh.c: split out array printing routine into its own function.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 270b3f5667a872e7148d1e1ef82f462604f59950 Author: Mihai Moldovan Date: Wed Jul 29 11:41:55 2020 +0200 src/x2goclient-network-ssh.c: split out array printing routine into its own function. We could probably use it in multiple places. --- src/x2goclient-network-ssh.c | 63 +--- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 32d92cd..feab49c 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -134,6 +134,7 @@ static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork *parent, GError **gerr); static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkSSH *self, GError **gerr); static void x2goclient_network_ssh_log_std_str (const gchar * const str, const gsize str_size, const _Bool select_stderr); +static void x2goclient_network_ssh_ptrarray_print (GPtrArray * const arr, const gchar * const prelude); static void x2goclient_network_ssh_class_init (X2GoClientNetworkSSHClass *klass) { @@ -950,33 +951,7 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork *parent } if (ret) { -{ - /* - * Yeah, this is potentially slow, but there is no better way to use - * g_log (). - */ - gchar *tmp = g_strdup ("Would try to connect via:"); - for (gsize i = 0; i < ssh_cmd->len; ++i) { -gchar *tmp_new = NULL; -gchar *cur_entry = (gchar *)g_ptr_array_index (ssh_cmd, i); -const gchar *empty = "(NULL)"; - -if (cur_entry) { - tmp_new = g_strdup_printf ("%s [%s]", tmp, cur_entry); -} -else { - tmp_new = g_strdup_printf ("%s [%s]", tmp, empty); -} - -g_free (tmp); - -tmp = tmp_new; - } - g_log (NULL, G_LOG_LEVEL_DEBUG, "%s", tmp); - - g_free (tmp); - tmp = NULL; -} +x2goclient_network_ssh_gptrarray_print (ssh_cmd, "Would try to connect via:"); g_log (NULL, G_LOG_LEVEL_DEBUG, "Launching!"); GError *ssh_err = NULL; @@ -1125,3 +1100,37 @@ static void x2goclient_network_ssh_log_std_str (const gchar * const str, const g g_log (NULL, G_LOG_LEVEL_DEBUG, "Std%s: no data", stream); } } + +static void x2goclient_network_ssh_gptrarray_print (GPtrArray * const arr, const gchar * const prelude) { + g_return_if_fail (arr); + + /* + * Yeah, this is potentially slow, but there is no better way to use + * g_log (). + */ + gchar *tmp = NULL; + const gchar *empty = "(NULL)"; + if (prelude) { +tmp = g_strdup (prelude); + } + + for (gsize i = 0; i < arr->len; ++i) { +gchar *tmp_new = NULL; +gchar *cur_entry = (gchar *)g_ptr_array_index (arr, i); + +if (cur_entry) { + tmp_new = g_strdup_printf ("%s [%s]", tmp, cur_entry); +} +else { + tmp_new = g_strdup_printf ("%s [%s]", tmp, empty); +} + +g_free (tmp); + +tmp = tmp_new; + } + g_log (NULL, G_LOG_LEVEL_DEBUG, "%s", tmp); + + g_free (tmp); + tmp = NULL; +} -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 02/44: src/x2goclient-network-ssh.c: add active_master_conn instance variable, scheduled to replace master_conn.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit f8c71aaa1e14f8d8d10d262d1596d70740459da3 Author: Mihai Moldovan Date: Wed Jul 29 10:59:26 2020 +0200 src/x2goclient-network-ssh.c: add active_master_conn instance variable, scheduled to replace master_conn. --- src/x2goclient-network-ssh.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 010810d..472f7db 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -104,6 +104,7 @@ struct _X2GoClientNetworkSSH { char *control_path; GSubprocess *master_conn; + gboolean active_master_conn; }; G_DEFINE_TYPE (X2GoClientNetworkSSH, x2goclient_network_ssh, X2GOCLIENT_TYPE_NETWORK); @@ -171,6 +172,7 @@ static void x2goclient_network_ssh_init (X2GoClientNetworkSSH *self) { self->control_path = NULL; self->master_conn = NULL; + self->active_master_conn = NULL; } X2GoClientNetworkSSH* x2goclient_network_ssh_new (const char * const session_path) { @@ -692,7 +694,9 @@ static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_SSH (self), ret); - if (self->master_conn) { + if (self->active_master_conn) { +/* FIXME: rework this code! */ + /* Cleanup, if necessary. */ g_log (NULL, G_LOG_LEVEL_DEBUG, "Master connection cleanup required."); @@ -722,6 +726,7 @@ static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * g_object_unref (self->master_conn); self->master_conn = NULL; +self->active_master_conn = FALSE; ret = TRUE; } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 09/44: src/x2goclient-network-ssh.c: split out appending host (and, if applicable, port) to an GPtrArray to a new function called x2goclient_network_ssh_sshcmd_add_host_
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit fcb526e1347e8a9d7b2f59350bc6e4e461e8bc48 Author: Mihai Moldovan Date: Thu Jul 30 11:59:03 2020 +0200 src/x2goclient-network-ssh.c: split out appending host (and, if applicable, port) to an GPtrArray to a new function called x2goclient_network_ssh_sshcmd_add_host_port (). Just a code move, really, but we'll need that later on. --- src/x2goclient-network-ssh.c | 181 +++ 1 file changed, 98 insertions(+), 83 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 9f11df6..e833ead 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -136,6 +136,7 @@ static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkS static void x2goclient_network_ssh_log_std_str (const gchar * const str, const gsize str_size, const _Bool select_stderr); static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const arr, const gchar * const prelude, gchar ** const ret_str); static void x2goclient_network_ssh_gptrarray_print_debug (GPtrArray * const arr, const gchar * const prelude, const gchar * const desc); +static gboolean x2goclient_network_ssh_sshcmd_add_host_port (X2GoClientNetworkSSH * const self, GPtrArray * const ssh_cmd, GError ** const gerr); static void x2goclient_network_ssh_class_init (X2GoClientNetworkSSHClass * const klass) { @@ -783,90 +784,8 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const GPtrArray *ssh_cmd = g_ptr_array_new_with_free_func (_clear_strings); g_ptr_array_add (ssh_cmd, g_strdup ("ssh")); - GSocketAddress *sock_addr = NULL; - if (ret) { -g_object_get (G_OBJECT (self), "socket", _addr, NULL); - -if (!(sock_addr)) { - g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_SOCK_ADDR_NULL, "No end point to connect to."); - ret = FALSE; -} - } - - if (ret) { -if (G_IS_UNIX_SOCKET_ADDRESS (sock_addr)) { - GUnixSocketAddress *unix_sock_addr = G_UNIX_SOCKET_ADDRESS (sock_addr); - - /* - * Tiny problem here: abstract sockets won't work. - * Since program arguments can't contain NULL bytes due to being C - * strings and every abstract socket already has to start with a NULL - * byte, we'll be just adding an empty argument here. - * - * Maybe there will be a way to do that correctly, some day. - */ - g_ptr_array_add (ssh_cmd, g_strdup (g_unix_socket_address_get_path (unix_sock_addr))); -} -else if (G_IS_INET_SOCKET_ADDRESS (sock_addr)) { - GInetSocketAddress *inet_sock_addr = G_INET_SOCKET_ADDRESS (sock_addr); - GInetAddress *inet_addr = g_inet_socket_address_get_address (inet_sock_addr); - guint16 port = g_inet_socket_address_get_port (inet_sock_addr); - - if (!(inet_addr)) { -g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_INET_ADDR_NULL, "Internet socket address is undefined, cannot connect to an unknown remote IP host."); -ret = FALSE; - } - else { -g_ptr_array_add (ssh_cmd, g_inet_address_to_string (inet_addr)); - -/* - * Handle port parameter, unless it's 0, which means to use the default - * value. - */ -if (port) { - g_ptr_array_add (ssh_cmd, g_strdup ("-p")); - g_ptr_array_add (ssh_cmd, g_strdup_printf ("%d", port)); -} - } -} -else if (G_IS_NATIVE_SOCKET_ADDRESS (sock_addr)) { - GNativeSocketAddress *native_sock_addr = G_NATIVE_SOCKET_ADDRESS (sock_addr); - - g_assert (sizeof (sockaddr_ho) == g_socket_address_get_native_size (sock_addr)); - - sockaddr_ho tmp_sockaddr = { 0 }; - - /* Fetch data. */ - GError *tmp_err = NULL; - g_socket_address_to_native (sock_addr, _sockaddr, sizeof (sockaddr_ho), _err); - - if (tmp_err) { -g_set_error (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_NATIVE_FETCH, "Unable to convert native socket address object to sockaddr struct: %s", tmp_err->message); -g_clear_error (_err); -ret = FALSE; - } - - if (ret) { -g_ptr_array_add (ssh_cmd, g_strdup (tmp_sockaddr.sho_addr)); - -/* - * Handle port parameter, unless it's 0, which means to use the default - * value. - */ -if (tmp_sockaddr.sho_port) { - g_ptr_array_add (ssh_cmd, g_strdup ("-p")); - g_ptr_array_add (ssh_cmd, g_strdup_printf ("%d", tmp_sockaddr.sho_port)); -} - } -} -else { - g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_SOCK_ADDR_UNKNOWN, "Unknown data in socket property, can't connect."); - ret = FALSE;
[X2Go-Commits] [libx2goclient] 42/44: src/x2goclient-network-ssh.c: make check thread main loop an instance variable.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 5157e75a20f454eec8927509b8efd146d063520b Author: Mihai Moldovan Date: Fri Sep 18 01:42:46 2020 +0200 src/x2goclient-network-ssh.c: make check thread main loop an instance variable. This allows us to modify/control it from other places too (like the main thread that creates master connection). This is especially interesting if anything destroys the connection object, since we we'll need to terminate the check thread as well in this case. --- src/x2goclient-network-ssh.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index bfdce29..d0e9a95 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -119,6 +119,7 @@ struct _X2GoClientNetworkSSH { GMutex check_thread_mutex; GThread *check_thread; GMainContext *check_thread_context; + GMainLoop *check_thread_loop; }; G_DEFINE_TYPE (X2GoClientNetworkSSH, x2goclient_network_ssh, X2GOCLIENT_TYPE_NETWORK); @@ -207,6 +208,7 @@ static void x2goclient_network_ssh_init (X2GoClientNetworkSSH * const self) { g_mutex_init (&(self->check_thread_mutex)); self->check_thread = NULL; self->check_thread_context = NULL; + self->check_thread_loop = NULL; } X2GoClientNetworkSSH* x2goclient_network_ssh_new (const char * const session_path) { @@ -253,6 +255,10 @@ static void x2goclient_network_ssh_finalize (GObject * const object) { /* Remove timeout source. */ g_mutex_lock (&(self->check_thread_mutex)); + if (self->check_thread_loop) { +g_main_context_invoke_full (self->check_thread_context, G_PRIORITY_DEFAULT_IDLE, G_SOURCE_FUNC (_main_loop_quit), self->check_thread_loop, NULL); + } + if (self->check_timeout_source) { g_source_destroy (self->check_timeout_source); g_source_unref (self->check_timeout_source); @@ -1454,7 +1460,6 @@ static void x2goclient_network_ssh_check_timeout_data_free (struct x2goclient_ne static gpointer x2goclient_network_ssh_check_timeout_thread_main (const gpointer user_data) { gpointer ret = NULL; - GMainLoop *main_loop = NULL; X2GoClientNetworkSSH *self = user_data; g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_SSH (self), ret); @@ -1464,13 +1469,13 @@ static gpointer x2goclient_network_ssh_check_timeout_thread_main (const gpointer g_main_context_push_thread_default (self->check_thread_context); g_mutex_unlock (&(self->check_thread_mutex)); - /* Add new main loop and execute it. */ - main_loop = g_main_loop_new (main_context, FALSE); - g_main_loop_run (main_loop); + /* Execute main loop. */ + g_main_loop_run (self->check_thread_loop); g_mutex_lock (&(self->check_thread_mutex)); /* Clean up everything after g_main_loop_run () returned. */ - g_main_loop_unref (main_loop); + g_main_loop_unref (self->check_thread_loop); + self->check_thread_loop = NULL; /* Unmap context. */ g_main_context_pop_thread_default (self->check_thread_context); @@ -1492,6 +1497,9 @@ static gboolean x2goclient_network_ssh_start_check_timeout (X2GoClientNetworkSSH g_mutex_lock (&(self->check_thread_mutex)); self->check_thread_context = g_main_context_new (); + /* Create new main loop. */ + self->check_thread_loop = g_main_loop_new (self->check_thread_context, FALSE); + /* Create and start thread. */ self->check_thread = g_thread_new ("check_thread", _network_ssh_check_timeout_thread_main, self); g_mutex_unlock (&(self->check_thread_mutex)); @@ -1614,6 +1622,9 @@ static gboolean x2goclient_network_ssh_check_timeout (const gpointer data) { /* Also, mark the master connection as terminated/gone. */ self->active_master_conn = FALSE; + +/* Finally, stop the main loop. */ +g_main_loop_quit (self->check_thread_loop); g_mutex_unlock (&(self->check_thread_mutex)); } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 14/44: src/test/sshtest.c: add locale.h header, needed for setlocale () and friends.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 27f6fa5d9f2360635465186ad30321ce72f88bd3 Author: Mihai Moldovan Date: Fri Jul 31 11:08:27 2020 +0200 src/test/sshtest.c: add locale.h header, needed for setlocale () and friends. Fixes a compile error that was previously hidden by compiler optimizations. --- src/test/sshtest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/sshtest.c b/src/test/sshtest.c index 21c23b1..1e5c21d 100644 --- a/src/test/sshtest.c +++ b/src/test/sshtest.c @@ -24,6 +24,7 @@ #include #include +#include #include -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 25/44: src/x2goclient-network.c: add getter and setters for {write, read}-only properties.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit ddeb5313ffa880e392d1fb103102dc21a9a0864b Author: Mihai Moldovan Date: Wed Aug 5 14:26:33 2020 +0200 src/x2goclient-network.c: add getter and setters for {write,read}-only properties. Even though the glib system will disallow access to these properties, it doesn't hurt to have the infrastructure available in case this ever changes. --- src/x2goclient-network.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 2ce92a6..d076817 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -212,6 +212,10 @@ static void x2goclient_network_set_property (GObject * const object, guint prop_ priv->socket_spec = g_value_dup_boxed (value); priv->socket = x2goclient_network_parse_sockspec (self, priv->socket_spec); break; +case (X2GO_NET_PROP_SOCKET): + g_clear_object (&(priv->socket)); + priv->socket = g_value_dup_object (value); + break; case (X2GO_NET_PROP_OPTIONS): g_clear_object (&(priv->options)); priv->options = g_value_dup_object (value); @@ -235,6 +239,9 @@ static void x2goclient_network_get_property (GObject * const object, const guint X2GoClientNetworkPrivate *priv = x2goclient_network_get_instance_private (self); switch (prop_id) { +case (X2GO_NET_PROP_SOCKET_SPEC): + g_value_set_boxed (value, priv->socket_spec); + break; case (X2GO_NET_PROP_SOCKET): g_value_set_object (value, priv->socket); break; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 01/44: src/x2goclient-openssh-version.c: typo fix in error string.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 3fe03cac2487ca631c41574bbf30de29fc1106a2 Author: Mihai Moldovan Date: Wed Jul 29 10:44:59 2020 +0200 src/x2goclient-openssh-version.c: typo fix in error string. --- src/x2goclient-openssh-version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-openssh-version.c b/src/x2goclient-openssh-version.c index f169428..2525bcd 100644 --- a/src/x2goclient-openssh-version.c +++ b/src/x2goclient-openssh-version.c @@ -618,7 +618,7 @@ X2GoClientOpenSSHVersion* x2goclient_openssh_version_fetch_openssh_version (GErr ssh_proc_comm_cancel = NULL; } else { -g_propagate_prefixed_error (gerr, ssh_err, "OpenSSH vesion fetching process didn't execute/start successfully! Error: "); +g_propagate_prefixed_error (gerr, ssh_err, "OpenSSH version fetching process didn't execute/start successfully! Error: "); } g_clear_error (_err); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 16/44: src/x2goclient-network-ssh.c: fix x2goclient_network_ssh_log_std_str (): actual decrease the size counter.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 387254cdc3c8f06d943ba7bc9795bf701396bf42 Author: Mihai Moldovan Date: Fri Jul 31 11:59:54 2020 +0200 src/x2goclient-network-ssh.c: fix x2goclient_network_ssh_log_std_str (): actual decrease the size counter. Previously, the function didn't do that (unless the size was INT_MAX), so the loop never stopped... until the program crashed due to illegal memory accesses. --- src/x2goclient-network-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index e639bd8..635aecf 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -936,7 +936,6 @@ static void x2goclient_network_ssh_log_std_str (const gchar * const str, const g if (INT_MAX < str_size_work) { cur_len = INT_MAX; -str_size_work -= INT_MAX; } const char *fmt = ">>>%.*s<<<"; @@ -953,6 +952,7 @@ static void x2goclient_network_ssh_log_std_str (const gchar * const str, const g * Be extra careful here. */ str_work += cur_len; + str_size_work -= cur_len; cont = TRUE; } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 32/44: src/test/sshtest.c: sleep for 30 seconds after connection has been established, then tear everything down.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 8ea258e2414bc30cec10096b829671d316746c59 Author: Mihai Moldovan Date: Mon Sep 14 06:23:37 2020 +0200 src/test/sshtest.c: sleep for 30 seconds after connection has been established, then tear everything down. --- src/test/sshtest.c | 4 1 file changed, 4 insertions(+) diff --git a/src/test/sshtest.c b/src/test/sshtest.c index 07e9ff6..f8fc78a 100644 --- a/src/test/sshtest.c +++ b/src/test/sshtest.c @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -112,6 +113,9 @@ int main (const int argc, const char * const * const argv) { 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 (_ssh); return (ret); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 10/44: src/x2goclient-network-ssh.c: don't assign NULL to a (g)boolean.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit b98389b0713cb46cd50a6c45fbe0358f9fb3dbf6 Author: Mihai Moldovan Date: Thu Jul 30 12:06:26 2020 +0200 src/x2goclient-network-ssh.c: don't assign NULL to a (g)boolean. This should have been FALSE, naturally. --- src/x2goclient-network-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index e833ead..7344546 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -175,7 +175,7 @@ static void x2goclient_network_ssh_init (X2GoClientNetworkSSH * const self) { self->control_path = NULL; self->master_conn = NULL; - self->active_master_conn = NULL; + self->active_master_conn = FALSE; } X2GoClientNetworkSSH* x2goclient_network_ssh_new (const char * const session_path) { -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 29/44: src/x2goclient-network-ssh.c: actually assign data to check_thread instance variable.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 8feeaae7d2ae5371352910493078c9c1be9c4f1f Author: Mihai Moldovan Date: Mon Sep 7 23:46:35 2020 +0200 src/x2goclient-network-ssh.c: actually assign data to check_thread instance variable. --- src/x2goclient-network-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index eb83c29..c67b67e 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1470,7 +1470,7 @@ static gboolean x2goclient_network_ssh_start_check_timeout (X2GoClientNetworkSSH g_mutex_lock (&(self->check_thread_mutex)); self->check_thread_context = g_main_context_new (); g_mutex_unlock (&(self->check_thread_mutex)); - g_thread_new ("check_thread", _network_ssh_check_timeout_thread_main, g_main_context_ref (self->check_thread_context)); + self->check_thread = g_thread_new ("check_thread", _network_ssh_check_timeout_thread_main, g_main_context_ref (self->check_thread_context)); x2goclient_network_ssh_start_check_timeout_invoke (self, gerr); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 26/44: src/x2goclient-network.{c, h}: make parent_connection function pointer a read-only property called connect-function acting on an instance private called connect_f
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 7ee08cf186d31789e6c496f199ee96d04c6847d5 Author: Mihai Moldovan Date: Wed Aug 5 14:55:33 2020 +0200 src/x2goclient-network.{c,h}: make parent_connection function pointer a read-only property called connect-function acting on an instance private called connect_function, add getter and setter. This makes it way safer to use, especially since it can now be truly immutable, only set once in this class's initialization. --- src/x2goclient-network.c | 18 -- src/x2goclient-network.h | 1 - 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index d076817..6ba5b24 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -55,6 +55,7 @@ typedef struct X2GoClientNetworkPrivate_ { X2GoClientNetworkOptions *options; gchar *session_path; /* Will eventually be replaced with a session object, probably. */ gboolean connected; + gboolean (*connect_func) (X2GoClientNetwork * const self, GError ** const gerr); } X2GoClientNetworkPrivate; G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (X2GoClientNetwork, x2goclient_network, G_TYPE_OBJECT); @@ -73,6 +74,7 @@ enum { X2GO_NET_PROP_OPTIONS, X2GO_NET_PROP_SESSION_PATH, X2GO_NET_PROP_CONNECTED, + X2GO_NET_PROP_CONN_FUNC, X2GO_NET_N_PROPERTIES }; @@ -129,9 +131,12 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE); - g_object_class_install_properties (object_class, X2GO_NET_N_PROPERTIES, net_obj_properties); + net_obj_properties[X2GO_NET_PROP_CONN_FUNC] = g_param_spec_pointer ("connect-function", _("Pointer to this instance's connect function"), + _("A pointer to the instance's connect function. " +"This is supposed to be immutable."), + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE); - klass->parent_connect = _network_connect; + g_object_class_install_properties (object_class, X2GO_NET_N_PROPERTIES, net_obj_properties); } static void x2goclient_network_init (X2GoClientNetwork * const self) { @@ -141,6 +146,7 @@ static void x2goclient_network_init (X2GoClientNetwork * const self) { priv->options = NULL; priv->session_path = NULL; priv->connected = FALSE; + priv->connect_func = _network_connect; } static void x2goclient_network_dispose (GObject * const object) { @@ -162,6 +168,8 @@ static void x2goclient_network_finalize (GObject * const object) { g_free (priv->session_path); priv->session_path = NULL; + priv->connect_func = NULL; + (G_OBJECT_CLASS (x2goclient_network_parent_class))->finalize (object); } @@ -228,6 +236,9 @@ static void x2goclient_network_set_property (GObject * const object, guint prop_ case (X2GO_NET_PROP_CONNECTED): priv->connected = g_value_get_boolean (value); break; +case (X2GO_NET_PROP_CONN_FUNC): +priv->connect_func = g_value_get_pointer (value); +break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, param_spec); break; @@ -254,6 +265,9 @@ static void x2goclient_network_get_property (GObject * const object, const guint case (X2GO_NET_PROP_CONNECTED): g_value_set_boolean (value, priv->connected); break; +case (X2GO_NET_PROP_CONN_FUNC): +g_value_set_pointer (value, priv->connect_func); +break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, param_spec); break; diff --git a/src/x2goclient-network.h b/src/x2goclient-network.h index 5e0c15d..cf96c35 100644 --- a/src/x2goclient-network.h +++ b/src/x2goclient-network.h @@ -59,7 +59,6 @@ struct _X2GoClientNetworkClass { /*< private >*/ GSocketAddress* (*parse_sockspec) (X2GoClientNetwork * const self, const GString * const sockspec); - gboolean (*parent_connect) (X2GoClientNetwork * const self, GError ** const gerr); /* We might need a lot more functions... */ gpointer padding[50]; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org
[X2Go-Commits] [libx2goclient] 06/44: src/x2goclient-network-ssh.c: rename x2goclient_network_ssh_ptrarray_print () to x2goclient_network_ssh_gptrarray_to_string () and fully rework it.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit e1100f6544bda45fb0ab19525d53694f060dfb99 Author: Mihai Moldovan Date: Thu Jul 30 09:59:20 2020 +0200 src/x2goclient-network-ssh.c: rename x2goclient_network_ssh_ptrarray_print () to x2goclient_network_ssh_gptrarray_to_string () and fully rework it. Instead of having it print out the result directly via g_log (and not having any control of the actual printing), make it return a boolean value indicating errors and a string as an output parameter. This way, callers can handle the string however they want. Additionally, pre-calculate the size of the resulting string (checking for size-based wrapping along the way) and copy data in chunks instead of using the old Shlemiel-The-Painter algorithm. --- src/x2goclient-network-ssh.c | 160 ++- 1 file changed, 141 insertions(+), 19 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index feab49c..f43a894 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -134,7 +134,7 @@ static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork *parent, GError **gerr); static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkSSH *self, GError **gerr); static void x2goclient_network_ssh_log_std_str (const gchar * const str, const gsize str_size, const _Bool select_stderr); -static void x2goclient_network_ssh_ptrarray_print (GPtrArray * const arr, const gchar * const prelude); +static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const arr, const gchar * const prelude, gchar ** const ret_str); static void x2goclient_network_ssh_class_init (X2GoClientNetworkSSHClass *klass) { @@ -951,7 +951,21 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork *parent } if (ret) { -x2goclient_network_ssh_gptrarray_print (ssh_cmd, "Would try to connect via:"); +gchar *ssh_cmd_str = NULL; +if (x2goclient_network_ssh_gptrarray_to_string (ssh_cmd, "Would try to connect via:", _cmd_str)) { + if (ssh_cmd_str) { +g_log (NULL, G_LOG_LEVEL_DEBUG, "%s", ssh_cmd_str); + +g_free (ssh_cmd_str); +ssh_cmd_str = NULL; + } + else { +g_log (NULL, G_LOG_LEVEL_DEBUG, "Unable to print out OpenSSH client command, it was completely empty."); + } +} +else { + g_log (NULL, G_LOG_LEVEL_DEBUG, "Unable to print out OpenSSH client command, internal error (the string likely was too big)."); +} g_log (NULL, G_LOG_LEVEL_DEBUG, "Launching!"); GError *ssh_err = NULL; @@ -1101,36 +1115,144 @@ static void x2goclient_network_ssh_log_std_str (const gchar * const str, const g } } -static void x2goclient_network_ssh_gptrarray_print (GPtrArray * const arr, const gchar * const prelude) { - g_return_if_fail (arr); +static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const arr, const gchar * const prelude, gchar ** const ret_str) { +#define SIZE_LOW_WRAP(buffer_size, elem_size) ((G_MAXSIZE - (buffer_size)) < ((elem_size))) + gboolean ret = FALSE; + + g_return_val_if_fail (((arr) && (ret_str)), ret); + + *(ret_str) = NULL; - /* - * Yeah, this is potentially slow, but there is no better way to use - * g_log (). - */ gchar *tmp = NULL; const gchar *empty = "(NULL)"; + const gsize empty_size = strlen (empty); + + /* Account for terminating NULL. */ + gsize size = 1; + + /* + * First, calculate the total size. + * + * Calculating the size and printing will take two iterations, but that's + * still better than a lot of reallocations and data moves. + */ + ret = TRUE; if (prelude) { -tmp = g_strdup (prelude); +const gsize elem_size = strlen (prelude); + +if (SIZE_LOW_WRAP (size, elem_size)) { + ret = FALSE; +} +else { + size += elem_size; +} } + for (gsize i = 0; ((i < arr->len) && (ret)); ++i) { +const gchar *cur_entry = g_ptr_array_index (arr, i); + +gsize additional_chars = 0; +/* Account for the potential additional chars " []". */ +if ((0 == i) && (!(prelude))) { + /* No space character necessary if we don't have a prelude. */ + additional_chars = 2; +} +else { + additional_chars = 3; +} + +if (SIZE_LOW_WRAP (size, additional_chars)) { + ret = FALSE; + continue; +} - for (gsize i = 0; i < arr->len; ++i) { -gchar *tmp_new = NULL; -gchar *cur_entry = (gchar *)g_ptr_array_index (arr, i); +size += additional_chars; +gsize elem_size = 0; if (cur_entry) { - tmp_new = g_strdup_printf ("%s [%s]", tmp, cur_entry); + elem_size = strlen (cur_entry); } else { - tmp_new =
[X2Go-Commits] [libx2goclient] 40/44: src/x2goclient-network-ssh.c: let x2goclient_network_ssh_finalize () make more use of the mutex.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit b6d34d01c14f4c68be30c42fa648457b85af2e45 Author: Mihai Moldovan Date: Thu Sep 17 11:59:59 2020 +0200 src/x2goclient-network-ssh.c: let x2goclient_network_ssh_finalize () make more use of the mutex. While doing so, keep the mutex clear while joining the check thread. Otherwise, we'll run into a nasty deadlock: - main thread takes lock - main thread kills check thread's main loop (currently not done, TBD) - main thread waits for check thread termination (join) - check thread tries to acquire lock after main loop termination to continue executing/cleaning up and terminating its main function - both threads wait forever. --- src/x2goclient-network-ssh.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index daa0605..082ddc0 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -258,11 +258,20 @@ static void x2goclient_network_ssh_finalize (GObject * const object) { g_source_unref (self->check_timeout_source); self->check_timeout_source = NULL; } - g_mutex_unlock (&(self->check_thread_mutex)); /* Let last event run out and thread terminate. */ if (self->check_thread) { +/* + * Keep the mutex clear while joining the thread. + * + * Otherwise, the thread's main function won't continue to execute (and + * finish) after its main loop (correctly) terminated. + */ +g_mutex_unlock (&(self->check_thread_mutex)); + (void) g_thread_join (self->check_thread); + +g_mutex_lock (&(self->check_thread_mutex)); self->check_thread = NULL; } @@ -271,6 +280,7 @@ static void x2goclient_network_ssh_finalize (GObject * const object) { * method, so let's just get rid of the pointer. */ self->check_thread_context = NULL; + g_mutex_unlock (&(self->check_thread_mutex)); g_mutex_clear (&(self->check_thread_mutex)); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 19/44: src/x2goclient-network.c: make x2goclient_network_connect () idempotent via the connected instance variable.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 88174ed8a2896e3bcd03029b131ac75cb41a5b32 Author: Mihai Moldovan Date: Mon Aug 3 11:23:38 2020 +0200 src/x2goclient-network.c: make x2goclient_network_connect () idempotent via the connected instance variable. --- src/x2goclient-network.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 40afb8e..811d6e9 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -181,12 +181,19 @@ gboolean x2goclient_network_connect (X2GoClientNetwork * const self, GError ** c gboolean ret = FALSE; X2GoClientNetworkClass *class = X2GOCLIENT_NETWORK_GET_CLASS (self); + X2GoClientNetworkPrivate *priv = x2goclient_network_get_instance_private (self); g_return_val_if_fail (X2GOCLIENT_IS_NETWORK (self), ret); g_return_val_if_fail (((NULL == gerr) || (NULL == *gerr)), ret); g_return_val_if_fail (class->connect, ret); - ret = class->connect (self, gerr); + ret = priv->connected; + + if (!(ret)) { +ret = class->connect (self, gerr); + +priv->connected = ret; + } return (ret); } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 03/44: src/x2goclient-network-ssh.c: fix UB when printing OpenSSH client command array elements being NULL (and hence not strings) and clean up the code a bit.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 5d6eef026538461eb9fcdebed5ff159fe9976c2b Author: Mihai Moldovan Date: Wed Jul 29 11:25:00 2020 +0200 src/x2goclient-network-ssh.c: fix UB when printing OpenSSH client command array elements being NULL (and hence not strings) and clean up the code a bit. --- src/x2goclient-network-ssh.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 472f7db..540ac1e 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -955,20 +955,21 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork *parent * Yeah, this is potentially slow, but there is no better way to use * g_log (). */ - const gchar *tmp_start = "Would try to connect via:"; - gchar *tmp = NULL; + gchar *tmp = g_strdup ("Would try to connect via:"); for (gsize i = 0; i < ssh_cmd->len; ++i) { gchar *tmp_new = NULL; +gchar *cur_entry = (gchar *)g_ptr_array_index (ssh_cmd, i); +const gchar *empty = "(NULL)"; -if (0 == i) { - tmp_new = g_strdup_printf ("%s [%s]", tmp_start, (gchar *)g_ptr_array_index (ssh_cmd, i)); +if (cur_entry) { + tmp_new = g_strdup_printf ("%s [%s]", tmp, cur_entry); } else { - tmp_new = g_strdup_printf ("%s [%s]", tmp, (gchar *)g_ptr_array_index (ssh_cmd, i)); - - g_free (tmp); + tmp_new = g_strdup_printf ("%s [%s]", tmp, empty); } +g_free (tmp); + tmp = tmp_new; } g_log (NULL, G_LOG_LEVEL_DEBUG, "%s", tmp); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 38/44: src/x2goclient-network-ssh.c: check thread pointer before joining check thread.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 69202fa73ab06742c75aaa424bcfb3eb8e6888e3 Author: Mihai Moldovan Date: Thu Sep 17 11:17:16 2020 +0200 src/x2goclient-network-ssh.c: check thread pointer before joining check thread. --- src/x2goclient-network-ssh.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 6b8b149..1ddc299 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -261,8 +261,10 @@ static void x2goclient_network_ssh_finalize (GObject * const object) { g_mutex_unlock (&(self->check_thread_mutex)); /* Let last event run out and thread terminate. */ - (void) g_thread_join (self->check_thread); - self->check_thread = NULL; + if (self->check_thread) { +(void) g_thread_join (self->check_thread); +self->check_thread = NULL; + } /* * Context should be gone by now, implicitly through the thread's main -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 33/44: src/x2goclient-network-ssh.c: make parameter to x2goclient_network_ssh_check_timeout_data_free const )not const-data).
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 8e4cad6b0fe9967f2deaeed0b85adfa60c0b9351 Author: Mihai Moldovan Date: Wed Sep 16 05:25:48 2020 +0200 src/x2goclient-network-ssh.c: make parameter to x2goclient_network_ssh_check_timeout_data_free const )not const-data). --- src/x2goclient-network-ssh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 40fa0de..eb6d3fd 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -158,7 +158,7 @@ static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const ar static void x2goclient_network_ssh_gptrarray_print_debug (GPtrArray * const arr, const gchar * const prelude, const gchar * const desc); static gboolean x2goclient_network_ssh_sshcmd_add_host_port (X2GoClientNetworkSSH * const self, GPtrArray * const ssh_cmd, GError ** const gerr); static gboolean x2goclient_network_ssh_start_sshcmd (X2GoClientNetworkSSH * const self, const GPtrArray * const ssh_cmd, GError ** const gerr, const gboolean master); -static void x2goclient_network_ssh_check_timeout_data_free (struct x2goclient_network_ssh_check_timeout_data *data); +static void x2goclient_network_ssh_check_timeout_data_free (struct x2goclient_network_ssh_check_timeout_data * const data); static gpointer x2goclient_network_ssh_check_timeout_thread_main (const gpointer user_data); static gboolean x2goclient_network_ssh_start_check_timeout (X2GoClientNetworkSSH * const self, GError ** const gerr); static void x2goclient_network_ssh_start_check_timeout_invoke (X2GoClientNetworkSSH * const self, GError ** const gerr); @@ -1434,7 +1434,7 @@ static gboolean x2goclient_network_ssh_start_sshcmd (X2GoClientNetworkSSH * cons return (ret); } -static void x2goclient_network_ssh_check_timeout_data_free (struct x2goclient_network_ssh_check_timeout_data *data) { +static void x2goclient_network_ssh_check_timeout_data_free (struct x2goclient_network_ssh_check_timeout_data * const data) { /* No need to clear any data within the structure. */ g_free (data); } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 27/44: src/x2goclient-network-ssh.c: use connect-function property to fetch parent connect function.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit c8853faa12e582e0584eed330d2054993bc4e972 Author: Mihai Moldovan Date: Wed Aug 5 15:37:03 2020 +0200 src/x2goclient-network-ssh.c: use connect-function property to fetch parent connect function. This includes a rather odd typedef for the parent connect function (proto)type, which is explained in a comment. --- src/x2goclient-network-ssh.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index af5682e..56e1cd3 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -63,6 +63,17 @@ struct _X2GoClientNetworkOptionsSSH { G_DEFINE_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ssh, X2GOCLIENT_TYPE_NETWORK_OPTIONS); + +/* + * This is a bit unsafe and odd, but we need a function pointer (proto)type + * for later use. + * + * It probably makes sense to keep it as generic as possible, though, to + * improve maintainability. + */ +typedef gboolean (*parent_connect_type) (void * const self, void * const gerr); + + static void x2goclient_network_options_ssh_class_init (X2GoClientNetworkOptionsSSHClass * const klass) { } @@ -757,7 +768,14 @@ gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH * const self, GErr X2GoClientNetwork *parent = X2GOCLIENT_NETWORK (self); X2GoClientNetworkClass *parent_class = X2GOCLIENT_NETWORK_GET_CLASS (parent); - ret = parent_class->parent_connect (parent, gerr); + /* Fetch parent's connect function. */ + parent_connect_type parent_connect = NULL; + g_object_get (G_OBJECT (self), "connect-function", _connect, NULL); + g_assert (parent_connect); + + if (parent_connect) { +ret = parent_connect (parent, gerr); + } return (ret); } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 21/44: src/x2goclient-network-ssh.c: use parent_connect function pointer in x2goclient_network_ssh_connect ().
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 5ce70da17ab8d1cf5de3d8aa4dbeb7040c3079d8 Author: Mihai Moldovan Date: Mon Aug 3 12:46:45 2020 +0200 src/x2goclient-network-ssh.c: use parent_connect function pointer in x2goclient_network_ssh_connect (). --- src/x2goclient-network-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 74740f7..af5682e 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -757,7 +757,7 @@ gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH * const self, GErr X2GoClientNetwork *parent = X2GOCLIENT_NETWORK (self); X2GoClientNetworkClass *parent_class = X2GOCLIENT_NETWORK_GET_CLASS (parent); - ret = parent_class->connect (parent, gerr); + ret = parent_class->parent_connect (parent, gerr); return (ret); } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 39/44: src/x2goclient-network-ssh.c: pass self instead of the main context to check thread main function.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit fc378873b96bb9673b4460dc85e14aa956c38534 Author: Mihai Moldovan Date: Thu Sep 17 11:39:39 2020 +0200 src/x2goclient-network-ssh.c: pass self instead of the main context to check thread main function. We'll eventually need this later on. Doing that sadly also means that we have to protect it through the mutex, including locking and unlocking calls in the check thread's main function. --- src/x2goclient-network-ssh.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 1ddc299..daa0605 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1444,21 +1444,31 @@ static void x2goclient_network_ssh_check_timeout_data_free (struct x2goclient_ne static gpointer x2goclient_network_ssh_check_timeout_thread_main (const gpointer user_data) { gpointer ret = NULL; - GMainContext *main_context = user_data; GMainLoop *main_loop; + X2GoClientNetworkSSH *self = user_data; + g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_SSH (self), ret); + + g_mutex_lock (&(self->check_thread_mutex)); /* Make given main context the default one for this thread. */ - g_main_context_push_thread_default (main_context); + g_main_context_push_thread_default (self->check_thread_context); + g_mutex_unlock (&(self->check_thread_mutex)); /* Add new main loop and execute it. */ main_loop = g_main_loop_new (main_context, FALSE); g_main_loop_run (main_loop); + g_mutex_lock (&(self->check_thread_mutex)); /* Clean up everything after g_main_loop_run () returned. */ g_main_loop_unref (main_loop); - g_main_context_pop_thread_default (main_context); - g_main_context_unref (main_context); + /* Unmap context. */ + g_main_context_pop_thread_default (self->check_thread_context); + + /* Destroy context. */ + g_main_context_unref (self->check_thread_context); + self->check_thread_context = NULL; + g_mutex_unlock (&(self->check_thread_mutex)); return (ret); } @@ -1471,8 +1481,10 @@ static gboolean x2goclient_network_ssh_start_check_timeout (X2GoClientNetworkSSH g_mutex_lock (&(self->check_thread_mutex)); self->check_thread_context = g_main_context_new (); + + /* Create and start thread. */ + self->check_thread = g_thread_new ("check_thread", _network_ssh_check_timeout_thread_main, self); g_mutex_unlock (&(self->check_thread_mutex)); - self->check_thread = g_thread_new ("check_thread", _network_ssh_check_timeout_thread_main, g_main_context_ref (self->check_thread_context)); x2goclient_network_ssh_start_check_timeout_invoke (self, gerr); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 31/44: src/x2goclient-network-ssh.c: change timeout check to 3000 ms (3 seconds) while debugging.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 7e61eea51fc5090dd590962e15c0a5bc925eb13e Author: Mihai Moldovan Date: Mon Sep 14 06:17:04 2020 +0200 src/x2goclient-network-ssh.c: change timeout check to 3000 ms (3 seconds) while debugging. Also, add notes to revert that after debugging and to make it non-static at some later time (to account for things like round-trip times if the control socket is non-local). --- src/x2goclient-network-ssh.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index dff177d..40fa0de 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1516,7 +1516,22 @@ static gboolean x2goclient_network_ssh_start_check_timeout_real (X2GoClientNetwo g_mutex_lock (&(self->check_thread_mutex)); /* Add source. */ - self->check_timeout_source = g_timeout_source_new (50); + /* FIXME: revert back to 50 ms after debugging. */ + /* FIXME: is a static value the right way to go here? + *Checking if the master connection is still alive every 50 ms is + *fine IFF the connection is local (i.e., a local UNIX socket). + *However, since we want to eventually forward UNIX sockets (one of + *the reasons for using OpenSSH instead of other libraries), a UNIX + *socket might not be local and it's not entirely unthinkable that + *we'll eventually forward even control UNIX sockets. + *In such a case, even though communication with the socket looks + *transparent to everything else, it will still incur round-trip + *times that might exceed our default value of 50 ms, which isn't a + *big problem per se, but wasting CPU and network resources. + *We'd be fine running the check every 5 round trips, so a static + *value is not that great, really. + */ + self->check_timeout_source = g_timeout_source_new (3000); /* Bind check function to timeout source. */ g_source_set_callback (self->check_timeout_source, _network_ssh_check_timeout, self, NULL); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 18/44: src/x2goclient-network.c: add connected boolean private instance variable and read-only getters and setters.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit b8e9b1f1362055abfd356d49f34276c67af379a9 Author: Mihai Moldovan Date: Mon Aug 3 11:11:20 2020 +0200 src/x2goclient-network.c: add connected boolean private instance variable and read-only getters and setters. --- src/x2goclient-network.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index c10a6b6..40afb8e 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -54,6 +54,7 @@ typedef struct X2GoClientNetworkPrivate_ { GSocketAddress *socket; X2GoClientNetworkOptions *options; gchar *session_path; /* Will eventually be replaced with a session object, probably. */ + gboolean connected; } X2GoClientNetworkPrivate; G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (X2GoClientNetwork, x2goclient_network, G_TYPE_OBJECT); @@ -71,6 +72,7 @@ enum { X2GO_NET_PROP_SOCKET, X2GO_NET_PROP_OPTIONS, X2GO_NET_PROP_SESSION_PATH, + X2GO_NET_PROP_CONNECTED, X2GO_NET_N_PROPERTIES }; @@ -121,6 +123,12 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) g_boxed_free (G_TYPE_GSTRING, default_session_path); default_session_path = NULL; + net_obj_properties[X2GO_NET_PROP_CONNECTED] = g_param_spec_boolean ("connected", _("Boolean for connected state"), + _("Boolean value denoting whether a connection has " +"been established or not."), + FALSE, + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE); + g_object_class_install_properties (object_class, X2GO_NET_N_PROPERTIES, net_obj_properties); } @@ -130,6 +138,7 @@ static void x2goclient_network_init (X2GoClientNetwork * const self) { priv->socket = NULL; priv->options = NULL; priv->session_path = NULL; + priv->connected = FALSE; } static void x2goclient_network_dispose (GObject * const object) { @@ -203,6 +212,9 @@ static void x2goclient_network_set_property (GObject * const object, guint prop_ g_clear_object (&(priv->options)); priv->options = g_value_dup_object (value); break; +case (X2GO_NET_PROP_CONNECTED): +priv->connected = g_value_get_boolean (value); +break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, param_spec); break; @@ -223,6 +235,9 @@ static void x2goclient_network_get_property (GObject * const object, const guint case (X2GO_NET_PROP_SESSION_PATH): g_value_set_string (value, priv->session_path); break; +case (X2GO_NET_PROP_CONNECTED): +g_value_set_boolean (value, priv->connected); +break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, param_spec); break; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 24/44: src/x2goclient-network.c: reorder properties in setter to keep original order.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 3d8d50f014d8c486f28876490d54ba968a48b12f Author: Mihai Moldovan Date: Wed Aug 5 14:17:00 2020 +0200 src/x2goclient-network.c: reorder properties in setter to keep original order. --- src/x2goclient-network.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 83f51b1..2ce92a6 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -212,15 +212,15 @@ static void x2goclient_network_set_property (GObject * const object, guint prop_ priv->socket_spec = g_value_dup_boxed (value); priv->socket = x2goclient_network_parse_sockspec (self, priv->socket_spec); break; +case (X2GO_NET_PROP_OPTIONS): + g_clear_object (&(priv->options)); + priv->options = g_value_dup_object (value); + break; case (X2GO_NET_PROP_SESSION_PATH): g_free (priv->session_path); priv->session_path = NULL; priv->session_path = g_value_dup_string (value); break; -case (X2GO_NET_PROP_OPTIONS): - g_clear_object (&(priv->options)); - priv->options = g_value_dup_object (value); - break; case (X2GO_NET_PROP_CONNECTED): priv->connected = g_value_get_boolean (value); break; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 17/44: src/x2goclient-network-ssh.c: implement master connection status check.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 9ac958189ccf99fab481be438297a6ad35834fa1 Author: Mihai Moldovan Date: Fri Jul 31 12:06:59 2020 +0200 src/x2goclient-network-ssh.c: implement master connection status check. --- src/x2goclient-network-ssh.c | 75 1 file changed, 75 insertions(+) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 635aecf..74740f7 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -104,6 +104,7 @@ struct _X2GoClientNetworkSSH { char *control_path; gboolean active_master_conn; + guint check_timeout; }; G_DEFINE_TYPE (X2GoClientNetworkSSH, x2goclient_network_ssh, X2GOCLIENT_TYPE_NETWORK); @@ -137,6 +138,9 @@ static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const ar static void x2goclient_network_ssh_gptrarray_print_debug (GPtrArray * const arr, const gchar * const prelude, const gchar * const desc); static gboolean x2goclient_network_ssh_sshcmd_add_host_port (X2GoClientNetworkSSH * const self, GPtrArray * const ssh_cmd, GError ** const gerr); static gboolean x2goclient_network_ssh_start_sshcmd (X2GoClientNetworkSSH * const self, const GPtrArray * const ssh_cmd, GError ** const gerr, const gboolean master); +static gboolean x2goclient_network_ssh_start_check_timeout (X2GoClientNetworkSSH * const self, GError ** const gerr); + +static gboolean x2goclient_network_ssh_check_timeout (const gpointer self); static void x2goclient_network_ssh_class_init (X2GoClientNetworkSSHClass * const klass) { @@ -175,6 +179,7 @@ static void x2goclient_network_ssh_init (X2GoClientNetworkSSH * const self) { self->control_path = NULL; self->active_master_conn = FALSE; + self->check_timeout = 0; } X2GoClientNetworkSSH* x2goclient_network_ssh_new (const char * const session_path) { @@ -219,6 +224,13 @@ static void x2goclient_network_ssh_finalize (GObject * const object) { * connection, so make sure that the dependencies are set up correctly here. */ + if (self->check_timeout) { +if (!(g_source_remove (self->check_timeout))) { + g_log (NULL, G_LOG_LEVEL_CRITICAL, "Unable to remove timeout with ID %u.", self->check_timeout); +} + } + self->check_timeout = 0; + if (!(x2goclient_network_ssh_kill_subprocesses (self))) { g_log (NULL, G_LOG_LEVEL_CRITICAL, "Some subprocesses were not terminated correctly!"); } @@ -876,6 +888,10 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const self->active_master_conn = ret = x2goclient_network_ssh_start_sshcmd (self, ssh_cmd, gerr, TRUE); } + if (ret) { +ret = x2goclient_network_ssh_start_check_timeout (self, gerr); + } + g_free (session_path); session_path = NULL; @@ -1350,3 +1366,62 @@ static gboolean x2goclient_network_ssh_start_sshcmd (X2GoClientNetworkSSH * cons return (ret); } + +static gboolean x2goclient_network_ssh_start_check_timeout (X2GoClientNetworkSSH * const self, GError ** const gerr) { + gboolean ret = FALSE; + + g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_SSH (self), ret); + g_return_val_if_fail (((NULL == gerr) || (NULL == *gerr)), ret); + + guint check_id = g_timeout_add (50, _network_ssh_check_timeout, self); + + ret = (!(!(check_id))); + + if (ret) { +self->check_timeout = check_id; + } + + return (ret); +} + +static gboolean x2goclient_network_ssh_check_timeout (const gpointer data) { + gboolean ret = FALSE; + + X2GoClientNetworkSSH *self = X2GOCLIENT_NETWORK_SSH (data); + + g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_SSH (self), ret); + + GPtrArray *ssh_cmd = g_ptr_array_new_with_free_func (_clear_strings); + g_ptr_array_add (ssh_cmd, g_strdup ("ssh")); + + /* Add control path options. */ + g_ptr_array_add (ssh_cmd, g_strdup ("-o")); + g_ptr_array_add (ssh_cmd, g_strdup_printf ("ControlPath=\"%s\"", self->control_path)); + + /* Add master socket command. */ + g_ptr_array_add (ssh_cmd, g_strdup ("-O")); + g_ptr_array_add (ssh_cmd, g_strdup ("check")); + + ret = x2goclient_network_ssh_sshcmd_add_host_port (self, ssh_cmd, NULL); + + if (ret) { +/* Zero-terminate. */ +g_ptr_array_add (ssh_cmd, NULL); + +/* Okay, execute. */ +x2goclient_network_ssh_gptrarray_print_debug (ssh_cmd, "Checking master connection statuus via:", "OpenSSH client command"); + +g_log (NULL, G_LOG_LEVEL_DEBUG, "Launching!"); +ret = x2goclient_network_ssh_start_sshcmd (self, ssh_cmd, NULL, FALSE); + } + + if (!(ret)) { +/* We'll return FALSE, so make sure to reset the instance variable. */ +self->check_timeout = 0; + +/* Also, mark the master connection is terminated/gone. */ +self->active_master_conn = FALSE; + } + + return (ret); +} -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on
[X2Go-Commits] [libx2goclient] 22/44: src/test/sshtest.c: test connection status getter and setter.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 9e9d174d4b834506665ae52881a6c16685012697 Author: Mihai Moldovan Date: Mon Aug 3 12:48:47 2020 +0200 src/test/sshtest.c: test connection status getter and setter. --- src/test/sshtest.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/test/sshtest.c b/src/test/sshtest.c index 1e5c21d..fca6bf5 100644 --- a/src/test/sshtest.c +++ b/src/test/sshtest.c @@ -82,8 +82,26 @@ int main (const int argc, const char * const * const argv) { g_free (session_path); session_path = NULL; + /* + * Check connection status fetching and setting. + * + * The latter should fail. + */ + g_printf ("Trying to get connection status...\n"); + gboolean conn_ret = TRUE; + g_object_get (G_OBJECT (net_ssh), "connected", _ret, NULL); + g_printf ("Current connection status: %d\n", (int) (conn_ret)); + + g_printf ("Trying to set connection status (should fail)...\n"); + conn_ret = TRUE; + g_object_set (G_OBJECT (net_ssh), "connected", _ret, NULL); + + g_printf ("Trying to get connection status again...\n"); + g_object_get (G_OBJECT (net_ssh), "connected", _ret, NULL); + g_printf ("Current connection status (again): %d\n", (int) (conn_ret)); + g_printf ("Trying to connect...\n"); - gboolean conn_ret = x2goclient_network_ssh_connect (net_ssh, NULL); + conn_ret = x2goclient_network_ssh_connect (net_ssh, NULL); g_printf ("Connection status: %s.\n", (conn_ret) ? "true" : "false"); g_clear_object (_ssh); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 43/44: src/x2goclient-network-ssh.c: add comment only.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit f89c2dccf442b4ac49a455b248072309ae61f97a Author: Mihai Moldovan Date: Fri Sep 18 01:44:50 2020 +0200 src/x2goclient-network-ssh.c: add comment only. --- src/x2goclient-network-ssh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index d0e9a95..607c41e 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1495,6 +1495,7 @@ static gboolean x2goclient_network_ssh_start_check_timeout (X2GoClientNetworkSSH g_return_val_if_fail (((NULL == gerr) || (NULL == *gerr)), ret); g_mutex_lock (&(self->check_thread_mutex)); + /* Create main context. */ self->check_thread_context = g_main_context_new (); /* Create new main loop. */ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 07/44: src/x2goclient-network-ssh.c: add another helper function x2goclient_network_ssh_gptrarray_print_debug (), wrapping the GPtrArray printing to g_log () and its DEB
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit ca8983d9615d4f97e7d99c5e059ed1d5ae6a6be7 Author: Mihai Moldovan Date: Thu Jul 30 10:52:11 2020 +0200 src/x2goclient-network-ssh.c: add another helper function x2goclient_network_ssh_gptrarray_print_debug (), wrapping the GPtrArray printing to g_log () and its DEBUG target. We'll probably use it later on again, so split this out. --- src/x2goclient-network-ssh.c | 42 +++--- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index f43a894..3bdedd2 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -135,6 +135,7 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork *parent static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkSSH *self, GError **gerr); static void x2goclient_network_ssh_log_std_str (const gchar * const str, const gsize str_size, const _Bool select_stderr); static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const arr, const gchar * const prelude, gchar ** const ret_str); +static void x2goclient_network_ssh_gptrarray_print_debug (GPtrArray * const arr, const gchar * const prelude, const gchar * const desc); static void x2goclient_network_ssh_class_init (X2GoClientNetworkSSHClass *klass) { @@ -951,21 +952,7 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork *parent } if (ret) { -gchar *ssh_cmd_str = NULL; -if (x2goclient_network_ssh_gptrarray_to_string (ssh_cmd, "Would try to connect via:", _cmd_str)) { - if (ssh_cmd_str) { -g_log (NULL, G_LOG_LEVEL_DEBUG, "%s", ssh_cmd_str); - -g_free (ssh_cmd_str); -ssh_cmd_str = NULL; - } - else { -g_log (NULL, G_LOG_LEVEL_DEBUG, "Unable to print out OpenSSH client command, it was completely empty."); - } -} -else { - g_log (NULL, G_LOG_LEVEL_DEBUG, "Unable to print out OpenSSH client command, internal error (the string likely was too big)."); -} +x2goclient_network_ssh_gptrarray_print_debug (ssh_cmd, "Would try to connect via:", "OpenSSH client command"); g_log (NULL, G_LOG_LEVEL_DEBUG, "Launching!"); GError *ssh_err = NULL; @@ -1256,3 +1243,28 @@ static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const ar #undef HANDLE_TRUNC #undef SIZE_LOW_WRAP } + +static void x2goclient_network_ssh_gptrarray_print_debug (GPtrArray * const arr, const gchar * const prelude, const gchar * const desc) { + gchar *arr_str = NULL; + const gchar *def_desc = "unspecified pointer array"; + const gchar *real_desc = def_desc; + + if (desc) { +real_desc = desc; + } + + if (x2goclient_network_ssh_gptrarray_to_string (arr, prelude, _str)) { +if (arr_str) { + g_log (NULL, G_LOG_LEVEL_DEBUG, "%s", arr_str); + + g_free (arr_str); + arr_str = NULL; +} +else { + g_log (NULL, G_LOG_LEVEL_DEBUG, "Unable to print out %s, it was completely empty.", real_desc); +} + } + else { +g_log (NULL, G_LOG_LEVEL_DEBUG, "Unable to print out %s, internal error (the string likely was too big).", real_desc); + } +} -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 04/44: src/x2goclient-network-ssh.c: replace "stderr" parameter to x2goclient_network_ssh_log_std_str () with "select_stderr".
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit e536f5459b631f757342ee440a2fb09254c26858 Author: Mihai Moldovan Date: Wed Jul 29 11:38:24 2020 +0200 src/x2goclient-network-ssh.c: replace "stderr" parameter to x2goclient_network_ssh_log_std_str () with "select_stderr". We didn't mean to hide the global symbol, so... let's just not do this. --- src/x2goclient-network-ssh.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 540ac1e..32d92cd 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -133,7 +133,7 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec (X2GoClientNetwork static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH *self); static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork *parent, GError **gerr); static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkSSH *self, GError **gerr); -static void x2goclient_network_ssh_log_std_str (const gchar * const str, const gsize str_size, const _Bool stderr); +static void x2goclient_network_ssh_log_std_str (const gchar * const str, const gsize str_size, const _Bool select_stderr); static void x2goclient_network_ssh_class_init (X2GoClientNetworkSSHClass *klass) { @@ -1075,7 +1075,7 @@ static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkS return (ret); } -static void x2goclient_network_ssh_log_std_str (const gchar * const str, const gsize str_size, const _Bool stderr) { +static void x2goclient_network_ssh_log_std_str (const gchar * const str, const gsize str_size, const _Bool select_stderr) { /* * For a size bigger than zero, the bytes object must be non-NULL, * otherwise any value is legit according to the documentation. @@ -1084,7 +1084,7 @@ static void x2goclient_network_ssh_log_std_str (const gchar * const str, const g const gchar *stream = "out"; - if (stderr) { + if (select_stderr) { stream = "err"; } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 12/44: src/x2goclient-network-ssh.c: rewrite x2goclient_network_ssh_kill_subprocesses () to not kill an actual process but spawn an OpenSSH client process executing an e
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit b871c1b39fcb71b7198bcb0094bc19bcd60527b9 Author: Mihai Moldovan Date: Thu Jul 30 15:05:01 2020 +0200 src/x2goclient-network-ssh.c: rewrite x2goclient_network_ssh_kill_subprocesses () to not kill an actual process but spawn an OpenSSH client process executing an exit command for the master connection. --- src/x2goclient-network-ssh.c | 45 +++- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 48a75a4..fded0cb 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -699,40 +699,33 @@ static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_SSH (self), ret); if (self->active_master_conn) { -/* FIXME: rework this code! */ - /* Cleanup, if necessary. */ g_log (NULL, G_LOG_LEVEL_DEBUG, "Master connection cleanup required."); -g_subprocess_force_exit (self->master_conn); +GPtrArray *ssh_cmd = g_ptr_array_new_with_free_func (_clear_strings); +g_ptr_array_add (ssh_cmd, g_strdup ("ssh")); -GCancellable *wait_cancel = g_cancellable_new (); -GError *wait_error = NULL; -while (!(g_subprocess_wait (self->master_conn, wait_cancel, _error))) { - /* - * Try to wait for subprocess termination really hard. - * The wait call should only fail if the operation was cancelled, but - * given that we don't do that (explicitly), it should not occur in the - * first place. - */ - g_log (NULL, G_LOG_LEVEL_CRITICAL, "Waiting on master connection subprocess termination was cancelled!\nError: %s\nThis should not have happened. Retrying.", wait_error->message); +/* Add control path options. */ +g_ptr_array_add (ssh_cmd, g_strdup ("-o")); +g_ptr_array_add (ssh_cmd, g_strdup_printf ("ControlPath=\"%s\"", self->control_path)); - g_clear_error (_error); -} +/* Add master socket command. */ +g_ptr_array_add (ssh_cmd, g_strdup ("-O")); +g_ptr_array_add (ssh_cmd, g_strdup ("exit")); -if (0 == g_subprocess_get_if_exited (self->master_conn)) { - gint exit_status = g_subprocess_get_exit_status (self->master_conn); - g_log (NULL, G_LOG_LEVEL_WARNING, "Master connection subprocess exited with an error; return code: %d", exit_status); -} -else { - g_log (NULL, G_LOG_LEVEL_MESSAGE, "Master connection subprocess exited successfully."); -} +ret = x2goclient_network_ssh_sshcmd_add_host_port (self, ssh_cmd, NULL); -g_object_unref (self->master_conn); -self->master_conn = NULL; -self->active_master_conn = FALSE; +if (ret) { + /* Zero-terminate. */ + g_ptr_array_add (ssh_cmd, NULL); -ret = TRUE; + /* Okay, execute. */ + x2goclient_network_ssh_gptrarray_print_debug (ssh_cmd, "Terminating master connection via:", "OpenSSH client command"); + + g_log (NULL, G_LOG_LEVEL_DEBUG, "Launching!"); + ret = x2goclient_network_ssh_start_sshcmd (self, ssh_cmd, NULL, FALSE); + self->active_master_conn = (!(ret)); +} } return (ret); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] 08/44: misc src/: constify all function parameters.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit c57d50c7fe6d116432729737a81671dbd98c1c12 Author: Mihai Moldovan Date: Thu Jul 30 11:55:31 2020 +0200 misc src/: constify all function parameters. This does not change the data, only makes the parameters themselves const. I'd like to avoid changing these, so making them const sounds like a good idea. --- src/test/sshtest.c | 2 +- src/x2goclient-network-ssh.c | 56 src/x2goclient-network-ssh.h | 4 +-- src/x2goclient-network.c | 30 ++--- src/x2goclient-network.h | 6 ++--- src/x2goclient-openssh-bugs.c| 4 +-- src/x2goclient-openssh-bugs.h| 4 +-- src/x2goclient-openssh-version.c | 6 ++--- src/x2goclient-openssh-version.h | 6 ++--- src/x2goclient-utils.c | 4 +-- src/x2goclient-utils.h | 6 ++--- 11 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/test/sshtest.c b/src/test/sshtest.c index 770cec7..21c23b1 100644 --- a/src/test/sshtest.c +++ b/src/test/sshtest.c @@ -41,7 +41,7 @@ #define _(String) gettext (String) -int main (int argc, char **argv) { +int main (const int argc, const char * const * const argv) { int ret = EXIT_FAILURE; setlocale (LC_MESSAGES, ""); diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 3bdedd2..9f11df6 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -63,13 +63,13 @@ struct _X2GoClientNetworkOptionsSSH { G_DEFINE_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ssh, X2GOCLIENT_TYPE_NETWORK_OPTIONS); -static void x2goclient_network_options_ssh_class_init (X2GoClientNetworkOptionsSSHClass *klass) { +static void x2goclient_network_options_ssh_class_init (X2GoClientNetworkOptionsSSHClass * const klass) { } -static void x2goclient_network_options_ssh_init (X2GoClientNetworkOptionsSSH *self) { +static void x2goclient_network_options_ssh_init (X2GoClientNetworkOptionsSSH * const self) { } -GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH *self) { +GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH * const self) { GPtrArray *ret = NULL; g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_OPTIONS_SSH (self), ret); @@ -120,25 +120,25 @@ enum { static GParamSpec *net_ssh_obj_properties[X2GO_NET_SSH_N_PROPERTIES] = { NULL, }; -static void x2goclient_network_ssh_dispose (GObject *object); -static void x2goclient_network_ssh_finalize (GObject *object); -static void x2goclient_network_ssh_set_property (GObject *object, guint prop_id, const GValue * const value, GParamSpec *param_spec); -static void x2goclient_network_ssh_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *param_spec); +static void x2goclient_network_ssh_dispose (GObject * const object); +static void x2goclient_network_ssh_finalize (GObject * const object); +static void x2goclient_network_ssh_set_property (GObject * const object, const guint prop_id, const GValue * const value, GParamSpec * const param_spec); +static void x2goclient_network_ssh_get_property (GObject * const object, guint prop_id, GValue * const value, GParamSpec * const param_spec); static GSocketAddress* x2goclient_network_ssh_parse_sockspec_unix_socket (const GString * const sockspec); -static guint16 x2goclient_network_ssh_parse_sockspec_port (const GString * const portspec, GError **gerr); +static guint16 x2goclient_network_ssh_parse_sockspec_port (const GString * const portspec, GError ** const gerr); static GString* x2goclient_network_ssh_sanitize_sockspec (const GString * const sockspec); -static GSocketAddress* x2goclient_network_ssh_parse_sockspec_ip (const GString * const sockspec, const gboolean want_v6, GError **gerr); -static GSocketAddress* x2goclient_network_ssh_parse_sockspec_alias (const GString * const sockspec, GError **gerr); -static GSocketAddress* x2goclient_network_ssh_parse_sockspec (X2GoClientNetwork *parent, const GString * const sockspec); -static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH *self); -static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork *parent, GError **gerr); -static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkSSH *self, GError **gerr); +static GSocketAddress* x2goclient_network_ssh_parse_sockspec_ip (const GString * const sockspec, const gboolean want_v6, GError ** const gerr); +static GSocketAddress* x2goclient_network_ssh_parse_sockspec_alias (const GString * const sockspec, GError ** const gerr); +static GSocketAddress* x2goclient_network_ssh_parse_sockspec (X2GoClientNetwork * const parent, const GString * const sockspec); +static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * const
[X2Go-Commits] [libx2goclient] 28/44: src/x2goclient-network-ssh.c: move check timeout to a separate thread, add synchronization via a mutex.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 54e91eed4cb4e0b9d602ae3509f4d9dd09f3197b Author: Mihai Moldovan Date: Mon Aug 31 22:33:25 2020 +0200 src/x2goclient-network-ssh.c: move check timeout to a separate thread, add synchronization via a mutex. We cannot execute a timeout in the main (or, for that matter, callingg) thread, since that would require a running main loop. However, libx2goclient is supposed to be used by other applications and we cannot usefully force them into starting a glib main loop. Additionally, that would make executing any other code almost impossible, so that won't fly either way. Instead, spawn a different thread for this timer (timeout in glib-parlance) and synchronize access to instance variables (and, by extension, the newly added ones for the thread and the like). Also, make sure that the last check can run out correctly at object finalization time. --- src/x2goclient-network-ssh.c | 169 +++ 1 file changed, 153 insertions(+), 16 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 56e1cd3..eb83c29 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -115,12 +115,21 @@ struct _X2GoClientNetworkSSH { char *control_path; gboolean active_master_conn; - guint check_timeout; + GSource *check_timeout_source; + GMutex check_thread_mutex; + GThread *check_thread; + GMainContext *check_thread_context; }; G_DEFINE_TYPE (X2GoClientNetworkSSH, x2goclient_network_ssh, X2GOCLIENT_TYPE_NETWORK); +struct x2goclient_network_ssh_check_timeout_data { + X2GoClientNetworkSSH *self; + GError **gerr; +}; + + /* See src/x2goclient-network.c regarding abbreviations. */ enum { X2GO_NET_SSH_PROP_OPENSSH_VERSION = 1, @@ -149,8 +158,12 @@ static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const ar static void x2goclient_network_ssh_gptrarray_print_debug (GPtrArray * const arr, const gchar * const prelude, const gchar * const desc); static gboolean x2goclient_network_ssh_sshcmd_add_host_port (X2GoClientNetworkSSH * const self, GPtrArray * const ssh_cmd, GError ** const gerr); static gboolean x2goclient_network_ssh_start_sshcmd (X2GoClientNetworkSSH * const self, const GPtrArray * const ssh_cmd, GError ** const gerr, const gboolean master); +static void x2goclient_network_ssh_check_timeout_data_free (struct x2goclient_network_ssh_check_timeout_data *data); +static gpointer x2goclient_network_ssh_check_timeout_thread_main (const gpointer user_data); static gboolean x2goclient_network_ssh_start_check_timeout (X2GoClientNetworkSSH * const self, GError ** const gerr); - +static void x2goclient_network_ssh_start_check_timeout_invoke (X2GoClientNetworkSSH * const self, GError ** const gerr); +static gboolean x2goclient_network_ssh_start_check_timeout_idle_unwrap (const gpointer user_data); +static gboolean x2goclient_network_ssh_start_check_timeout_real (X2GoClientNetworkSSH * const self, GError ** const gerr); static gboolean x2goclient_network_ssh_check_timeout (const gpointer self); @@ -190,7 +203,10 @@ static void x2goclient_network_ssh_init (X2GoClientNetworkSSH * const self) { self->control_path = NULL; self->active_master_conn = FALSE; - self->check_timeout = 0; + self->check_timeout_source = NULL; + g_mutex_init (&(self->check_thread_mutex)); + self->check_thread = NULL; + self->check_thread_context = NULL; } X2GoClientNetworkSSH* x2goclient_network_ssh_new (const char * const session_path) { @@ -235,12 +251,26 @@ static void x2goclient_network_ssh_finalize (GObject * const object) { * connection, so make sure that the dependencies are set up correctly here. */ - if (self->check_timeout) { -if (!(g_source_remove (self->check_timeout))) { - g_log (NULL, G_LOG_LEVEL_CRITICAL, "Unable to remove timeout with ID %u.", self->check_timeout); -} + /* Remove timeout source. */ + g_mutex_lock (&(self->check_thread_mutex)); + if (self->check_timeout_source) { +g_source_destroy (self->check_timeout_source); +g_source_unref (self->check_timeout_source); +self->check_timeout_source = NULL; } - self->check_timeout = 0; + g_mutex_unlock (&(self->check_thread_mutex)); + + /* Let last event run out and thread terminate. */ + (void) g_thread_join (self->check_thread); + self->check_thread = NULL; + + /* + * Context should be gone by now, implicitly through the thread's main + * method, so let's just get rid of the pointer. + */ + self->check_thread_context = NULL; + + g_mutex_clear (&(self->check_thread_mutex)); if (!(x2goclient_network_ssh_kill_subprocesses (self))) { g_log (NULL, G_LOG_LEVEL_CRITICAL, "Some subprocesses were not terminated correctly!"); @@ -726,7 +756,10 @@ static gboolean
[X2Go-Commits] [libx2goclient] 13/44: src/x2goclient-network-ssh.c: remove master_conn instance variable.
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 1e36d6dfc0a24dbacbbcc8061e1d5e2acf243c2b Author: Mihai Moldovan Date: Thu Jul 30 15:05:25 2020 +0200 src/x2goclient-network-ssh.c: remove master_conn instance variable. --- src/x2goclient-network-ssh.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index fded0cb..6e85e16 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -103,7 +103,6 @@ struct _X2GoClientNetworkSSH { X2GoClientOpenSSHBugs *openssh_bugs; char *control_path; - GSubprocess *master_conn; gboolean active_master_conn; }; @@ -175,7 +174,6 @@ static void x2goclient_network_ssh_init (X2GoClientNetworkSSH * const self) { self->openssh_bugs = x2goclient_openssh_bugs_new (); self->control_path = NULL; - self->master_conn = NULL; self->active_master_conn = FALSE; } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [libx2goclient] branch master updated (afb65da -> 8491443)
This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository libx2goclient. from afb65da src/x2goclient-network-ssh.c: stop using g_printf (), use g_log () instead. new 3fe03ca src/x2goclient-openssh-version.c: typo fix in error string. new f8c71aa src/x2goclient-network-ssh.c: add active_master_conn instance variable, scheduled to replace master_conn. new 5d6eef0 src/x2goclient-network-ssh.c: fix UB when printing OpenSSH client command array elements being NULL (and hence not strings) and clean up the code a bit. new e536f54 src/x2goclient-network-ssh.c: replace "stderr" parameter to x2goclient_network_ssh_log_std_str () with "select_stderr". new 270b3f5 src/x2goclient-network-ssh.c: split out array printing routine into its own function. new e1100f6 src/x2goclient-network-ssh.c: rename x2goclient_network_ssh_ptrarray_print () to x2goclient_network_ssh_gptrarray_to_string () and fully rework it. new ca8983d src/x2goclient-network-ssh.c: add another helper function x2goclient_network_ssh_gptrarray_print_debug (), wrapping the GPtrArray printing to g_log () and its DEBUG target. new c57d50c misc src/: constify all function parameters. new fcb526e src/x2goclient-network-ssh.c: split out appending host (and, if applicable, port) to an GPtrArray to a new function called x2goclient_network_ssh_sshcmd_add_host_port (). new b98389b src/x2goclient-network-ssh.c: don't assign NULL to a (g)boolean. new d8ec4e0 src/x2goclient-network-ssh.{c,h}: split out OpenSSH client process spawning into a separate function called x2goclient_network_ssh_start_sshcmd (). new b871c1b src/x2goclient-network-ssh.c: rewrite x2goclient_network_ssh_kill_subprocesses () to not kill an actual process but spawn an OpenSSH client process executing an exit command for the master connection. new 1e36d6d src/x2goclient-network-ssh.c: remove master_conn instance variable. new 27f6fa5 src/test/sshtest.c: add locale.h header, needed for setlocale () and friends. new 285eeb3 src/x2goclient-network-ssh.c: re-order finalization. new 387254c src/x2goclient-network-ssh.c: fix x2goclient_network_ssh_log_std_str (): actual decrease the size counter. new 9ac9581 src/x2goclient-network-ssh.c: implement master connection status check. new b8e9b1f src/x2goclient-network.c: add connected boolean private instance variable and read-only getters and setters. new 88174ed src/x2goclient-network.c: make x2goclient_network_connect () idempotent via the connected instance variable. new ca3938f src/x2goclient-network.{c,h}: add new private parent_connect function pointer, to be used for x2goclient_network_connect (). new 5ce70da src/x2goclient-network-ssh.c: use parent_connect function pointer in x2goclient_network_ssh_connect (). new 9e9d174 src/test/sshtest.c: test connection status getter and setter. new 007bfa8 src/test/sshtest.c: try to connect a second time to see if the function is really idempotent now. new 3d8d50f src/x2goclient-network.c: reorder properties in setter to keep original order. new ddeb531 src/x2goclient-network.c: add getter and setters for {write,read}-only properties. new 7ee08cf src/x2goclient-network.{c,h}: make parent_connection function pointer a read-only property called connect-function acting on an instance private called connect_function, add getter and setter. new c8853fa src/x2goclient-network-ssh.c: use connect-function property to fetch parent connect function. new 54e91ee src/x2goclient-network-ssh.c: move check timeout to a separate thread, add synchronization via a mutex. new 8feeaae src/x2goclient-network-ssh.c: actually assign data to check_thread instance variable. new 115cda2 src/x2goclient-network-ssh.c: fix typo in debug message. new 7e61eea src/x2goclient-network-ssh.c: change timeout check to 3000 ms (3 seconds) while debugging. new 8ea258e src/test/sshtest.c: sleep for 30 seconds after connection has been established, then tear everything down. new 8e4cad6 src/x2goclient-network-ssh.c: make parameter to x2goclient_network_ssh_check_timeout_data_free const )not const-data). new 1a1e7d0 src/x2goclient-network-ssh.c: check timeout is not an idle source, rename unwrapping function to x2goclient_network_ssh_start_check_timeout_unwrap. new 67c9306 src/x2goclient-network-ssh.c: add parenthesis to cast, non-functional. new 9ba0651 src/test/sshtest.c: only try to connect again if the first connection succeeded. new 108c6b4 src/x2goclient-openssh-bugs.c: bump version requirement for stderr closing to 8.5+. new 69202fa
[X2Go-Commits] [[X2Go Wiki]] page changed: events:start
A page in your DokuWiki was added or changed. Here are the details: Date: 2020/09/17 19:31 Browser : Mozilla/5.0 (X11; Linux x86_64; rv:68.9) Gecko/20100101 Goanna/4.6 Firefox/68.9 PaleMoon/28.13.0 IP-Address : 82.212.29.219 Hostname: HSI-KBW-082-212-029-219.hsi.kabelbw.de Old Revision: https://wiki.x2go.org/doku.php/events:start?rev=1600371011 New Revision: https://wiki.x2go.org/doku.php/events:start Edit Summary: [2020-09-15 - OpenPOWER Summit North America 2020 - Virtual Event] User: stefanbaur @@ -35,9 +35,9 @@ = Past Events = 2020-09-15 - OpenPOWER Summit North America 2020 - Virtual Event * Talk: X2Go: Free/Libre/OpenSource Remote Desktop and Remote Application Services for Linux - on POWER (20-25 minutes, followed by 5-10 minutes of Q) * This will be an updated version of the 2018 talk at IBM Zurich's UnConference, but also more tailored to the Summit's audience - * The talk is a recording, the Q part was live + * The talk was prerecorded, the Q part was live * Time: 18:10 CEST * Link to talk: https://openpowerna2020.sched.com/event/173c259874a1c6815eba425421aff4d9 * Complete event schedule can be found here: https://openpowerna2020.sched.com/ * Official recording of the talk including live Q should be up on the [[https://www.youtube.com/channel/UCNVcHm09eXVbvUzZkQs0_Sg|OpenPOWER Foundation's YouTube Channel]] by early October, 2020 -- This mail was generated by DokuWiki at https://wiki.x2go.org/ ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [[X2Go Wiki]] page changed: events:start
A page in your DokuWiki was added or changed. Here are the details: Date: 2020/09/17 19:30 Browser : Mozilla/5.0 (X11; Linux x86_64; rv:68.9) Gecko/20100101 Goanna/4.6 Firefox/68.9 PaleMoon/28.13.0 IP-Address : 82.212.29.219 Hostname: HSI-KBW-082-212-029-219.hsi.kabelbw.de Old Revision: https://wiki.x2go.org/doku.php/events:start?rev=1600370762 New Revision: https://wiki.x2go.org/doku.php/events:start Edit Summary: [2020-09-15 - OpenPOWER Summit North America 2020 - Virtual Event] - added video links User: stefanbaur @@ -35,18 +35,18 @@ = Past Events = 2020-09-15 - OpenPOWER Summit North America 2020 - Virtual Event * Talk: X2Go: Free/Libre/OpenSource Remote Desktop and Remote Application Services for Linux - on POWER (20-25 minutes, followed by 5-10 minutes of Q) * This will be an updated version of the 2018 talk at IBM Zurich's UnConference, but also more tailored to the Summit's audience - * The talk will most likely be a recording, the Q will be live + * The talk is a recording, the Q part was live * Time: 18:10 CEST * Link to talk: https://openpowerna2020.sched.com/event/173c259874a1c6815eba425421aff4d9 * Complete event schedule can be found here: https://openpowerna2020.sched.com/ - - + * Official recording of the talk including live Q should be up on the [[https://www.youtube.com/channel/UCNVcHm09eXVbvUzZkQs0_Sg|OpenPOWER Foundation's YouTube Channel]] by early October, 2020 + * Our recording (sans Q) is already available [[https://youtu.be/Nzxy2_wtiSk|here]] 2020-03-14 - Pi and More 12 1/2, Stuttgart, Germany - CANCELLED/POSTPONED * Pi and More 12 1/2 has been cancelled/postponed due to Corona-Virus related regulations. * See https://piandmore.de/de/news/article/pi-and-more-12-verschoben (DE) / https://piandmore.de/en/news/article/pi-and-more-12-postponed (EN) for more info. = Earlier Years = [[events:2019]] [[events:2018]] [[events:2017]] [[events:2016]] [[events:2015]] [[events:2014]] [[events:2013]] [[events:2012]] -- This mail was generated by DokuWiki at https://wiki.x2go.org/ ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [[X2Go Wiki]] page changed: events:start
A page in your DokuWiki was added or changed. Here are the details: Date: 2020/09/17 19:26 Browser : Mozilla/5.0 (X11; Linux x86_64; rv:68.9) Gecko/20100101 Goanna/4.6 Firefox/68.9 PaleMoon/28.13.0 IP-Address : 82.212.29.219 Hostname: HSI-KBW-082-212-029-219.hsi.kabelbw.de Old Revision: https://wiki.x2go.org/doku.php/events:start?rev=1600370714 New Revision: https://wiki.x2go.org/doku.php/events:start Edit Summary: OpenPOWER Summit North America 2020 is now a thing of the past User: stefanbaur @@ -31,21 +31,22 @@ 2020-09-18 to 2020-09-20 - X2Go: The Gathering 2020, "V/RUS - Virtual/Remote User Symposium", Location: "shackspace", Stuttgart, Germany - Hybrid Event * The shackspace website can be found here: https://www.shackspace.de * As in the previous years, there's a sub-page with all the details: [[events:x2go-gathering-2020|Read more here...]] + = Past Events = 2020-09-15 - OpenPOWER Summit North America 2020 - Virtual Event * Talk: X2Go: Free/Libre/OpenSource Remote Desktop and Remote Application Services for Linux - on POWER (20-25 minutes, followed by 5-10 minutes of Q) * This will be an updated version of the 2018 talk at IBM Zurich's UnConference, but also more tailored to the Summit's audience * The talk will most likely be a recording, the Q will be live * Time: 18:10 CEST * Link to talk: https://openpowerna2020.sched.com/event/173c259874a1c6815eba425421aff4d9 * Complete event schedule can be found here: https://openpowerna2020.sched.com/ - = Past Events = + 2020-03-14 - Pi and More 12 1/2, Stuttgart, Germany - CANCELLED/POSTPONED * Pi and More 12 1/2 has been cancelled/postponed due to Corona-Virus related regulations. * See https://piandmore.de/de/news/article/pi-and-more-12-verschoben (DE) / https://piandmore.de/en/news/article/pi-and-more-12-postponed (EN) for more info. = Earlier Years = [[events:2019]] [[events:2018]] [[events:2017]] [[events:2016]] [[events:2015]] [[events:2014]] [[events:2013]] [[events:2012]] -- This mail was generated by DokuWiki at https://wiki.x2go.org/ ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [[X2Go Wiki]] page changed: events:start
A page in your DokuWiki was added or changed. Here are the details: Date: 2020/09/17 19:25 Browser : Mozilla/5.0 (X11; Linux x86_64; rv:68.9) Gecko/20100101 Goanna/4.6 Firefox/68.9 PaleMoon/28.13.0 IP-Address : 82.212.29.219 Hostname: HSI-KBW-082-212-029-219.hsi.kabelbw.de Old Revision: https://wiki.x2go.org/doku.php/events:start?rev=1599465213 New Revision: https://wiki.x2go.org/doku.php/events:start Edit Summary: [Tentative] Linuxday.AT 2020 CfP rejected User: stefanbaur @@ -16,9 +16,9 @@ Due to the Covid-19/Corona pandemic, a lot of these events are likely to get cancelled or turned into virtual events; some possibly on short notice. Please watch this site and the individual event sites for updates. * Hack4Glarus 2020.2 - 2020-12-04 - 2020-12-06 (No CfP yet) Replaced by Hack4Glarus Mini Editions in November, see https://hack4glarus.ch/ - Participation unclear * Linux Expo Ulm 2020 (together with Linux Presentation Day 2020.2), Ulm, Germany - if it takes place at all, it will be on 2020-11-21 * OpenPOWER Summit Europe 2020, ??? - some time around September-October 2020 (No CfP yet) //probably// cancelled? No info yet. - * LinuxDay.AT 2020 - 2020-10-10 - Virtual Event ([[https://www.linuxday.at/call-for-papers-2020|CfP]]: CfP sent, awaiting reply) + * LinuxDay.AT 2020 - 2020-10-10 - Virtual Event - Event takes place, but we are not among the speakers/presenters * TUEBIX 2020, Tübingen, Germany - 2020-06-20 (No CfP yet) cancelled * Hack4Glarus 2020.1 - 2020-06-05 - 2020-06-07 (No CfP yet) cancelled * LinuxWochen Wien, Vienna, Austria - TBD, original date has been cancelled, unclear if event will take place at all * Linux-Info-Tag Augsburg, Augsburg, Germany cancelled -- This mail was generated by DokuWiki at https://wiki.x2go.org/ ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [[X2Go Wiki]] page changed: events:x2go-gathering-2020
A page in your DokuWiki was added or changed. Here are the details: Date: 2020/09/17 19:18 Browser : Mozilla/5.0 (X11; Linux x86_64; rv:68.9) Gecko/20100101 Goanna/4.6 Firefox/68.9 PaleMoon/28.13.0 IP-Address : 82.212.29.219 Hostname: HSI-KBW-082-212-029-219.hsi.kabelbw.de Old Revision: https://wiki.x2go.org/doku.php/events:x2go-gathering-2020?rev=1600370210 New Revision: https://wiki.x2go.org/doku.php/events:x2go-gathering-2020 Edit Summary: [Event Schedule] Mike will not be joining us live for the presentation :'( User: stefanbaur @@ -62,9 +62,9 @@ | ~18:00h | Official Welcome | **Stefan** | | 18:00h-18:05h | today's agenda | **Stefan** | | 18:05h-18:25h | X2Go's State of the Union Address | **Stefan** | | 18:25h-18:35h | ** 10min ** break || - | 18:35h-18:55h | HTML5 Client for X2Go | Mike#1 | + | 18:35h-18:55h | HTML5 Client for X2Go | Mike#1 (prerecorded message due to scheduling conflict - no live Q, sadly) | | 18:55h-19:00h | ** 10min ** break || | 19:00h-19:20h | libx2goclient/X2Go Plugin for Remmina | Mihai | | 19:20h-19:30h | ** 10min ** break || | 19:30h-19:50h | Last year's changes and improvements to NX-libs | Uli | -- This mail was generated by DokuWiki at https://wiki.x2go.org/ ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [[X2Go Wiki]] page changed: events:x2go-gathering-2020
A page in your DokuWiki was added or changed. Here are the details: Date: 2020/09/17 19:16 Browser : Mozilla/5.0 (X11; Linux x86_64; rv:68.9) Gecko/20100101 Goanna/4.6 Firefox/68.9 PaleMoon/28.13.0 IP-Address : 82.212.29.219 Hostname: HSI-KBW-082-212-029-219.hsi.kabelbw.de Old Revision: https://wiki.x2go.org/doku.php/events:x2go-gathering-2020?rev=1600369249 New Revision: https://wiki.x2go.org/doku.php/events:x2go-gathering-2020 Edit Summary: [Event Schedule] added Jitsi/YT notice User: stefanbaur @@ -50,8 +50,12 @@ **ALL TIMES CEST** === Friday Schedule === Livestream can be found at: (Link TBA) + + We will be using a Jitsi session for the presentations. The session will be live-streamed to YouTube, so please follow the presentation on YouTube to keep the load on our Jitsi server down. Links to both the Jitsi server and the YouTube livestream will be linked above, some time between 17:00h-18:00h + + For Q, we will try to take questions via Jitsi, but also via YouTube chat and possibly IRC - we'll see how that goes. :-) ** Friday is a purely virtual event ** ^Time Slot ^ Topic ^ Speaker / Moderator ^ -- This mail was generated by DokuWiki at https://wiki.x2go.org/ ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [[X2Go Wiki]] page changed: events:x2go-gathering-2020
A page in your DokuWiki was added or changed. Here are the details: Date: 2020/09/17 19:00 Browser : Mozilla/5.0 (X11; Linux x86_64; rv:68.9) Gecko/20100101 Goanna/4.6 Firefox/68.9 PaleMoon/28.13.0 IP-Address : 82.212.29.219 Hostname: HSI-KBW-082-212-029-219.hsi.kabelbw.de Old Revision: https://wiki.x2go.org/doku.php/events:x2go-gathering-2020?rev=1600352237 New Revision: https://wiki.x2go.org/doku.php/events:x2go-gathering-2020 Edit Summary: [Event Schedule] (Mihai will be doing this part alone) User: stefanbaur @@ -60,9 +60,9 @@ | 18:05h-18:25h | X2Go's State of the Union Address | **Stefan** | | 18:25h-18:35h | ** 10min ** break || | 18:35h-18:55h | HTML5 Client for X2Go | Mike#1 | | 18:55h-19:00h | ** 10min ** break || - | 19:00h-19:20h | libx2goclient/X2Go Plugin for Remmina | Mihai / Mike#1 | + | 19:00h-19:20h | libx2goclient/X2Go Plugin for Remmina | Mihai | | 19:20h-19:30h | ** 10min ** break || | 19:30h-19:50h | Last year's changes and improvements to NX-libs | Uli | | 19:30h-19:40h | ** 10min ** break || | 19:40h-20:00h | An X2Go Use Case: Computational Fluid Dynamics as a cloud service | Chris Greenshields (CFD.direct) | -- This mail was generated by DokuWiki at https://wiki.x2go.org/ ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits
[X2Go-Commits] [[X2Go Wiki]] page changed: events:x2go-gathering-2020
A page in your DokuWiki was added or changed. Here are the details: Date: 2020/09/17 14:17 Browser : Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0 IP-Address : 82.212.29.219 Hostname: HSI-KBW-082-212-029-219.hsi.kabelbw.de Old Revision: https://wiki.x2go.org/doku.php/events:x2go-gathering-2020?rev=1599662867 New Revision: https://wiki.x2go.org/doku.php/events:x2go-gathering-2020 Edit Summary: [Event Schedule] final agenda User: stefanbaur @@ -48,12 +48,12 @@ = Event Schedule = **ALL TIMES CEST** === Friday Schedule === - - schedule/times are subject to change until this note is removed Livestream can be found at: (Link TBA) + + ** Friday is a purely virtual event ** ^Time Slot ^ Topic ^ Speaker / Moderator ^ | ~18:00h | Official Welcome | **Stefan** | | 18:00h-18:05h | today's agenda | **Stefan** | @@ -68,32 +68,25 @@ | 19:40h-20:00h | An X2Go Use Case: Computational Fluid Dynamics as a cloud service | Chris Greenshields (CFD.direct) | | 20:00h-20:10h | ** 10min ** break || | 20:10h-20:30h | Realtime audio compression in QVD: Benefits, implementation and challenges | Vadim Troshchinskiy (QVD) | | 20:30h-20:40h | ** 10min ** break || - | 20:40h-open end | Open Coding/Bugsquashing - please remember to make sufficient "airing out" breaks if meeting up in person || + | 20:40h-open end | Virtual Open Coding/Bugsquashing|| === Saturday Schedule === - - schedule/times are subject to change until this note is removed Livestream can be found at: (Link TBA) - Open Coding/Bugsquashing, exact times TBD; **Stefan** will be in charge of the "airing out" breaks (10 minutes every 20-30 minutes) + Open Coding/Bugsquashing, starting 10:00h; **Stefan** will be in charge of the "airing out" breaks (10 minutes every 20-30 minutes) === Sunday Schedule === - - Except for the ORCA meeting, schedule/times are subject to change until this note is removed Livestream can be found at: (Link TBA) ^Time Slot ^ Topic ^ Speaker / Moderator ^ - | 08:00h-08:05h | today's agenda | **Stefan** | - | 08:05h-09:50h | Open Coding/Bugsquashing - please remember to make sufficient "airing out" breaks | **Stefan** | - | 09:50h-10:00h | ** 10min ** break || | 10:00h-12:00h | ORCA Annual Meeting, see below | **Stefan** / Mike | - | 12:00h-evening | Open Coding/Bugsquashing - please remember to make sufficient "airing out" breaks / Lunch break around 13:00h | **Stefan** | + | 12:00h-evening | Optional Open Coding/Bugsquashing - please remember to make sufficient "airing out" breaks / Lunch break around 13:00h | **Stefan** | | evening | Cleaning Rage - tidy up the room - //note that only one person should be in the room and windows need to be open when vacuum cleaner is being used// | **Stefan** | | End of Event | Official Goodbye | **Stefan** | = ORCA e.V. annual meeting = -- This mail was generated by DokuWiki at https://wiki.x2go.org/ ___ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits