Subject: Bug#865 closed by Stefan Baur <[email-masked]> (Closing/Archiving)

From: [email-masked] (X2Go Bug Tracking System)
Date: Tue, 30 Jan 2024 22:00:05 +0000

This is an automatic notification regarding your Bug report
which was filed against the nx-libs package:

#865: New API call for nxcom (nx-libs) NXTransCleanupForReconnect

It has been closed by Stefan Baur <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Stefan Baur <[email-masked]> by
replying to this email.

-- 
865: https://bugs.x2go.org/cgi-bin/bugreport.cgi?bug=865
X2Go Bug Tracking System
Contact [email-masked] with problems

Subject: Closing/Archiving
From: Stefan Baur <[email-masked]>
To: [email-masked]
Date: Tue, 30 Jan 2024 22:57:03 +0100

Control: close -1
Control: archive -1

This bug has long since been moved to the Arctica Project Github issue 
tracker.

Kind Regards,
Stefan Baur
-- 
BAUR-ITCS UG (haftungsbeschränkt)
Geschäftsführer: Stefan Baur
Eichenäckerweg 10, 89081 Ulm | Registergericht Ulm, HRB 724364
Fon/Fax 0731 40 34 66-36/-35 | USt-IdNr.: DE268653243

Subject: New API call for nxcom (nx-libs) NXTransCleanupForReconnect
From: Nito Martinez <[email-masked]>
To: [email-masked]
Date: Fri, 08 May 2015 00:40:24 +0200

Package: nx-libs
Version: 3.5.0.28

Description:

The following patch includes support for a new API call 
NXTransCleanupForReconnect, which basically clears the state of nxcomp 
proxy side (modified nxproxy), so that a reconnection is possible.

Rationale:

Usually nxproxy clears the status of the connection by doing an exit and 
launching a new nxproxy. This strategy does not work for applications in 
IOS which do not allow forking.

Special care has been taking to not modify any of the other nxcomp code.

Regards,

Nito
diff --git a/nx-libs-3.5.0.22/nxcomp/Loop.cpp b/nx-libs-3.5.0.22/nxcomp/Loop.cpp
index 8c19467..16b757a 100644
--- a/nx-libs-3.5.0.22/nxcomp/Loop.cpp
+++ b/nx-libs-3.5.0.22/nxcomp/Loop.cpp
@@ -1311,6 +1311,11 @@ void NXTransCleanup()
   HandleCleanup();
 }

+void NXTransCleanupForReconnect()
+{
+  HandleCleanupForReconnect();
+}
+
 //
 // Check the parameters for subsequent
 // initialization of the NX transport.
@@ -4835,6 +4840,28 @@ int StartKeeper()
   return 1;
 }

+void HandleCleanupForReconnect()
+{
+  #ifdef TEST
+  *logofs << "Loop: Going to clean up system resources for Reconnect "
+          << "in process '" << getpid() << "'.\n"
+          << logofs_flush;
+  #endif
+  handleTerminatedInLoop();
+  DisableSignals();
+  if (control)
+    CleanupChildren();
+  CleanupListeners();
+  CleanupSockets();
+  CleanupKeeper();
+  CleanupStreams();
+  CleanupLocal();
+  CleanupGlobal();
+  RestoreSignals();
+  ServerCache::lastInitReply.set(0,NULL);
+  ServerCache::lastKeymap.set(0,NULL);
+  ServerCache::getKeyboardMappingLastMap.set(0,NULL);
+}
 void HandleCleanup(int code)
 {
   #ifdef TEST
diff --git a/nx-libs-3.5.0.22/nxcomp/Misc.h b/nx-libs-3.5.0.22/nxcomp/Misc.h
index 21a5030..0cc3969 100644
--- a/nx-libs-3.5.0.22/nxcomp/Misc.h
+++ b/nx-libs-3.5.0.22/nxcomp/Misc.h
@@ -140,6 +140,7 @@ void HandleShutdown() __attribute__((noreturn));
 extern "C"
 {
   void HandleCleanup(int code = 0) __attribute__((noreturn));
+  void HandleCleanupForReconnect();
 }

 //
diff --git a/nx-libs-3.5.0.22/nxcomp/NX.h b/nx-libs-3.5.0.22/nxcomp/NX.h
index 2dbf686..0e4734e 100644
--- a/nx-libs-3.5.0.22/nxcomp/NX.h
+++ b/nx-libs-3.5.0.22/nxcomp/NX.h
@@ -442,6 +442,14 @@ extern int NXTransParseEnvironment(const char *env, int force);

 extern void NXTransCleanup(void) __attribute__((noreturn));

+/*
+ * Cleans up the global and local state
+ * (the same way as NXTransCleanup does)
+ * but does not exit the process
+ * Needed for IOS platform
+ */
+extern void NXTransCleanupForReconnect(void);
+
 extern const char* NXVersion();
 extern int NXMajorVersion();
 extern int NXMinorVersion();