[X2Go-Commits] [nx-libs] 01/01: nxcomp: fix "negotiation in stage 10" error.

git-admin at x2go.org git-admin at x2go.org
Tue Jun 16 23:03:32 CEST 2015


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

x2go pushed a commit to branch 3.5.0.x
in repository nx-libs.

commit 371348148b9bedbb5eb0a401c1ff54a75adc9907
Author: Vadim Troshchinskiy <vtroshchinskiy at qindel.com>
Date:   Tue Jun 16 23:02:05 2015 +0200

    nxcomp: fix "negotiation in stage 10" error.
    
    Problem fixed by adding a select() call to implement a timeout,
    and retrying writes if needed.
    
    v2: backport to nx-libs 3.5.0.x (Mihai Moldovan)
    
    Adds:
      - 0660_nxcomp_fix-negotiation-in-stage-10-error.full+lite.patch
---
 debian/changelog                                   |    6 ++
 ...x-negotiation-in-stage-10-error.full+lite.patch |   67 ++++++++++++++++++++
 debian/patches/series                              |    1 +
 3 files changed, 74 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index db70137..16a4d2a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -231,6 +231,12 @@ nx-libs (2:3.5.0.32-0x2go1) UNRELEASED; urgency=low
     Adds:
     - 0992_fix-DEBUG-TEST-DUMP-FLUSH-TOKEN-PING-et-al-builds.full+lite.patch
 
+  [ Vadim Troshchinskiy ]
+  * nxcomp: fix "negotiation in stage 10" error.
+    v2: backport to nx-libs 3.5.0.x (Mihai Moldovan)
+    Adds:
+    - 0660_nxcomp_fix-negotiation-in-stage-10-error.full+lite.patch
+
  -- X2Go Release Manager <git-admin at x2go.org>  Tue, 17 Mar 2015 19:19:32 +0100
 
 nx-libs (2:3.5.0.31-0x2go1) unstable; urgency=low
diff --git a/debian/patches/0660_nxcomp_fix-negotiation-in-stage-10-error.full+lite.patch b/debian/patches/0660_nxcomp_fix-negotiation-in-stage-10-error.full+lite.patch
new file mode 100644
index 0000000..3d4c584
--- /dev/null
+++ b/debian/patches/0660_nxcomp_fix-negotiation-in-stage-10-error.full+lite.patch
@@ -0,0 +1,67 @@
+commit f982cbc85e9ffff24a6a348c3637b54a7e8cbc34
+Author: Vadim Troshchinskiy <vtroshchinskiy at qindel.com>
+Date:   Wed May 20 15:47:45 2015 +0200
+
+Fix negotiation in stage 10 error
+
+Problem fixed by adding a select() call to implement a timeout,
+and retrying writes if needed.
+
+v2: backport to nx-libs 3.5.0.x (Mihai Moldovan)
+
+--- a/nxcomp/Loop.cpp
++++ b/nxcomp/Loop.cpp
+@@ -8073,16 +8073,52 @@ int ReadRemoteData(int fd, char *buffer,
+ int WriteLocalData(int fd, const char *buffer, int size)
+ {
+   int position = 0;
++  int ret = 0;
++  fd_set writeSet;
++  struct timeval selectTs = {30, 0};
+ 
+   while (position < size)
+   {
++
++    // A write to a non-blocking socket may fail with EAGAIN. The problem is
++    // that cache data is done in several writes, and there's no easy way
++    // to handle failure without rewriting a significant amount of code.
++    //
++    // Bailing out of the outer loop would result in restarting the sending
++    // of the entire cache list, which would confuse the other side.
++
++    FD_ZERO(&writeSet);
++    FD_SET(fd, &writeSet);
++
++    ret = select(fd+1, NULL, &writeSet, NULL, &selectTs);
++
++    #ifdef DEBUG
++    *logofs << "Loop: WriteLocalData: select() returned with a code of " << ret << " and remaining timeout of "
++            << selectTs.tv_sec << " sec, " << selectTs.tv_usec << "usec\n" << logofs_flush;
++    #endif
++
++    if ( ret < 0 )
++    {
++      *logofs << "Loop: Error in select() when writing data to FD#" << fd << ": " << strerror(EGET()) << "\n" << logofs_flush;
++
++      if ( EGET() == EINTR )
++        continue;
++
++      return -1;
++    }
++    else if ( ret == 0 )
++    {
++      *logofs << "Loop: Timeout expired in select() when writing data to FD#" << fd << ": " << strerror(EGET()) << "\n" << logofs_flush;
++      return -1;
++    }
++
+     int result = write(fd, buffer + position, size - position);
+ 
+     getNewTimestamp();
+ 
+     if (result <= 0)
+     {
+-      if (result < 0 && EGET() == EINTR)
++      if (result < 0 && (EGET() == EINTR || EGET() == EAGAIN || EGET() == EWOULDBLOCK))
+       {
+         continue;
+       }
diff --git a/debian/patches/series b/debian/patches/series
index 7e5768f..b797339 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -81,6 +81,7 @@
 0630_nx-X11_fix-underlinking-dlopen-dlsym.full.patch
 0640_nx-X11_fix-underlinking-libNX_Xcomposite_damage_fixes.full.patch
 0650_nxcompshad_link-to-NX_Xext.full.patch
+0660_nxcomp_fix-negotiation-in-stage-10-error.full+lite.patch
 0990_fix-DEBUG-and-TEST-builds.full.patch
 0991_fix-hr-typos.full+lite.patch
 0991_fix-hr-typos.full.patch

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


More information about the x2go-commits mailing list