Hi Reinhard,

On  Sa 10 Mai 2014 22:07:12 CEST, Mike Gabriel wrote:

To this mail I have attached four patches:

1. x2goclient-reduce-fan-noise-with-libssh-0.6.x.patch

This patch is (IMHO, after some more reading of git diff) needed for X2Go Client << 4.0.1.4 to reduce the CPU fan noise when running with a libssh >= 0.6.1 under the hood.

2. libssh patches that are required with X2Go Client >= 4.0.2.0:

If you want to run an X2Go Client (>= 4.0.2.0) (like the one in our PPA) against a libssh (<< 0.6.1) you need these two patches

  0004-reset-global-request-status.patch
  0005-multi-reverse-fwd.patch

3. Speed improvements:

If you want to get things more rocking and really speed up X2Go via libssh, then you need this libssh patch, as well. (I think it entered libssh
upstream at 0.6.2, but I am not sure):

  0006-ssh-handle-package-zero-timeouts.patch


Reinhard pointed out that my previous mail did not have any patches. They are attached to this mail now.

Ubuntu downstream tasks:
------------------------
What needs to be done in Ubuntu IMHO is:

  o Test x2goclient-reduce-fan-noise-with-libssh-0.6.x.patch applied
    to x2goclient (<< 4.0.1.4) with libssh (>= 0.6.0).
  o Fix x2goclient (<< 4.0.1.4) in every Ubuntu version with libssh (>= 0.6.0)
with the attached patch x2goclient-reduce-fan-noise-with-libssh-0.6.x.patch.

For utopic you should sync Debian unstable once I have uploaded 0.6.3-1 to it.


X2Go upstream tasks:
--------------------
For our PPA we need to provide a libssh src:package containing the attached patches (0004... - 0006...). Those patches are picked from libssh upstream Git (and have been contributed to libssh by Oleksandr Shneyder). The current approach is using libssh 0.5.4-3 which contains those patches for all Ubuntu versions that do not yet ship Ubuntu 0.6.x (i.e. saucy, quantal, precise, lucid). And these packages in our PPA will receive security maintenance of course.

For trusty, I will upload the libssh version (0.6.3-1) from Debian experimental to our PPA sometime today (and also upload it to Debian unstable as it has been announced while back). I will maintain libssh 0.6.3-1 there, as well (according to Debian uploads).


If you want to help avoiding this PPA based libssh maintenance, then upload libssh packages containing patches 0004... - 0006... to all Ubuntu versions that do not yet have those patches. (Note: patch 0005... introduces new symbols to libssh).

Greets,
Mike








--

DAS-NETZWERKTEAM
mike gabriel, herweg 7, 24357 fleckeby
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: mike.gabr...@das-netzwerkteam.de, http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
diff --git a/sshmasterconnection.cpp b/sshmasterconnection.cpp
index 8355611..de73f0d 100755
--- a/sshmasterconnection.cpp
+++ b/sshmasterconnection.cpp
@@ -924,6 +924,9 @@ bool SshMasterConnection::userChallengeAuth()
 
 bool SshMasterConnection::userAuthWithPass()
 {
+    // Populate the userauth_list
+    ssh_userauth_none(my_ssh_session, NULL);
+
     int method = ssh_userauth_list(my_ssh_session, NULL);
 
     if (method& SSH_AUTH_METHOD_INTERACTIVE)
@@ -1445,7 +1448,7 @@ void SshMasterConnection::channelLoop()
         struct timeval tv;
 
         tv.tv_sec = 0;
-        tv.tv_usec = 500;
+        tv.tv_usec = 500000;
 
         int retval;
         int maxsock=-1;
Description: Allow requesting more than one channel per session.
Author: Andreas Schneider <a...@cryptomilk.org>
Abstract:
 In the 0.5.x series of libssh only one channel request per session
 is possible. This blocks using libssh client sessions which require
 requesting multiple channels on a single SSH connection.
Origin: http://git.libssh.org/projects/libssh.git/commit/src/channels.c?id=e30acdb58a86937e8bece57ce47e272f1106ca55
--- a/src/channels.c
+++ b/src/channels.c
@@ -1951,7 +1951,7 @@
       break;
 
   }
-
+  session->global_req_state = SSH_CHANNEL_REQ_STATE_NONE;
   leave_function();
   return rc;
 error:
Description: Allow requesting multiple reverse port forwarding tunnels per connection
Author: Oleksandr Shneyder <o.schney...@phoca-gmbh.de>
Abstract:
 Channel: Add ssh_channel_accept_forward().
 .
 This new function works the same way as ssh_forward_accept()
 but can return a destination port of the channel (useful if
 SSH connection is supposed to reverse forward multiple TCP/IP
 ports).
Origin: http://git.libssh.org/projects/libssh.git/commit/?id=a1c4fc07d43fb7a7e1e91bfdadbd3dc62b8ce462
--- a/include/libssh/libssh.h
+++ b/include/libssh/libssh.h
@@ -371,6 +371,7 @@
 LIBSSH_API char *ssh_dirname (const char *path);
 LIBSSH_API int ssh_finalize(void);
 LIBSSH_API ssh_channel ssh_forward_accept(ssh_session session, int timeout_ms);
+LIBSSH_API ssh_channel ssh_channel_accept_forward(ssh_session session, int timeout_ms, int *destination_port);
 LIBSSH_API int ssh_forward_cancel(ssh_session session, const char *address, int port);
 LIBSSH_API int ssh_forward_listen(ssh_session session, const char *address, int port, int *bound_port);
 LIBSSH_API void ssh_free(ssh_session session);
--- a/src/channels.c
+++ b/src/channels.c
@@ -1755,7 +1755,7 @@
 }
 
 static ssh_channel ssh_channel_accept(ssh_session session, int channeltype,
-    int timeout_ms) {
+    int timeout_ms, int *destination_port) {
 #ifndef _WIN32
   static const struct timespec ts = {
     .tv_sec = 0,
@@ -1779,6 +1779,10 @@
             ssh_message_subtype(msg) == channeltype) {
           ssh_list_remove(session->ssh_message_list, iterator);
           channel = ssh_message_channel_request_open_reply_accept(msg);
+          if(destination_port) {
+            *destination_port=msg->channel_request_open.destination_port;
+          }
+
           ssh_message_free(msg);
           return channel;
         }
@@ -1809,7 +1813,7 @@
  *                      the server.
  */
 ssh_channel ssh_channel_accept_x11(ssh_channel channel, int timeout_ms) {
-  return ssh_channel_accept(channel->session, SSH_CHANNEL_X11, timeout_ms);
+  return ssh_channel_accept(channel->session, SSH_CHANNEL_X11, timeout_ms, NULL);
 }
 
 /**
@@ -1857,7 +1861,7 @@
   } else {
     session->global_req_state=SSH_CHANNEL_REQ_STATE_DENIED;
   }
-
+  session->global_req_state = SSH_CHANNEL_REQ_STATE_NONE;
   leave_function();
   return SSH_PACKET_USED;
 
@@ -2027,7 +2031,23 @@
  *         the server
  */
 ssh_channel ssh_forward_accept(ssh_session session, int timeout_ms) {
-  return ssh_channel_accept(session, SSH_CHANNEL_FORWARDED_TCPIP, timeout_ms);
+  return ssh_channel_accept(session, SSH_CHANNEL_FORWARDED_TCPIP, timeout_ms, NULL);
+}
+
+/**
+ * @brief Accept an incoming TCP/IP forwarding channel and get information
+ * about incomming connection
+ * @param[in]  session    The ssh session to use.
+ *
+ * @param[in]  timeout_ms A timeout in milliseconds.
+ *
+ * @param[in]  destination_port A pointer to destination port or NULL.
+ *
+ * @return Newly created channel, or NULL if no incoming channel request from
+ *         the server
+ */
+ssh_channel ssh_channel_accept_forward(ssh_session session, int timeout_ms, int* destination_port) {
+  return ssh_channel_accept(session, SSH_CHANNEL_FORWARDED_TCPIP, timeout_ms, destination_port);
 }
 
 /**
Description: Handle packet timeouts properly (speed improvement)
Author: Oleksandr Shneyder <o.schney...@phoca-gmbh.de>
Origin: http://git.libssh.org/projects/libssh.git/commit/?id=d90478448985a1e21cc240fd87fc5a14b4bb978a
--- a/src/channels.c
+++ b/src/channels.c
@@ -1769,7 +1769,11 @@
 
   for (t = timeout_ms; t >= 0; t -= 50)
   {
-    ssh_handle_packets(session, 50);
+    if (timeout_ms == 0) {
+        ssh_handle_packets(session, 0);
+    } else {
+        ssh_handle_packets(session, 50);
+    }
 
     if (session->ssh_message_list) {
       iterator = ssh_list_get_iterator(session->ssh_message_list);

Attachment: pgpysoFHxPn5I.pgp
Description: Digitale PGP-Signatur

_______________________________________________
X2Go-Dev mailing list
X2Go-Dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/x2go-dev

Reply via email to