[X2Go-Commits] [x2goclient] 04/18: src/sshmasterconnection.cpp: replace deprecated channel_new () function with ssh_channel_new ().

git-admin at x2go.org git-admin at x2go.org
Wed Feb 8 20:50:25 CET 2017


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch feature/libssh-api-upgrade
in repository x2goclient.

commit d1e7566ee36be568552d0a07474fd2ff0b717a27
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Sat Jan 28 17:36:03 2017 +0100

    src/sshmasterconnection.cpp: replace deprecated channel_new () function with ssh_channel_new ().
    
    Might break on ancient systems, but we don't care.
    
    Also, add error handling in case ssh_channel_new () failed...
---
 debian/changelog            |    3 +++
 src/sshmasterconnection.cpp |   14 +++++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index b6c2ea7..28c1ba5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -573,6 +573,9 @@ x2goclient (4.1.0.0-0x2go1) UNRELEASED; urgency=medium
       first place.
     - src/sshmasterconnection.cpp: replace string_free () with its successor
       ssh_string_free (). Will break on ancient systems, but we don't care.
+    - src/sshmasterconnection.cpp: replace deprecated channel_new () function
+      with ssh_channel_new (). Might break on ancient systems, but we don't
+      care. Also, add error handling in case ssh_channel_new () failed...
 
   [ Bernard Cafarelli ]
   * New upstream version (4.1.0.0):
diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp
index 57ca78c..bb9a8dd 100644
--- a/src/sshmasterconnection.cpp
+++ b/src/sshmasterconnection.cpp
@@ -1555,7 +1555,19 @@ void SshMasterConnection::channelLoop()
 #ifdef DEBUG
                 x2goDebug<<"Creating new channel."<<endl;
 #endif
-                ssh_channel channel=channel_new ( my_ssh_session );
+                ssh_channel channel = ssh_channel_new ( my_ssh_session );
+
+                if (!channel) {
+                    QString err = ssh_get_error (my_ssh_session);
+                    QString error_msg = tr ("ssh_channel_new failed");
+                    emit ioErr (channelConnections[i].creator, error_msg + ".", err);
+
+#ifdef DEBUG
+                    x2goDebug << errorMsg << ": " << err << endl;
+#endif
+
+                    continue;
+                }
 #ifdef DEBUG
                 x2goDebug<<"New channel:"<<channel<<endl;
 #endif

--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list