[COMMIT] Revert part of Jerry's December gnuserv change

Aidan Kehoe <[email protected]> Sun, 8 Mar 2015 21:08:58 +0000
Newsgroups gmane.emacs.xemacs.patches
Message-ID <[email protected]>
APPROVE COMMIT

NOTE: This patch has been committed.

# HG changeset patch
# User Aidan Kehoe <[email protected]>
# Date 1425848365 0
#      Sun Mar 08 20:59:25 2015 +0000
# Node ID 1044acf60048098a0b60326561d732c7691a357a
# Parent  e9bb3688e654d8f944fbf2943f9f9d030e272501
Revert part of Jerry's December 2014 that broke gnuclient on some OS X.

lib-src/ChangeLog addition:

2015-03-08  Aidan Kehoe  <[email protected]>

	* gnuserv.c (echo_request):
	No longer close the file handle unconditionally, leave this to the
	individual socket types.
	* gnuserv.c (handle_internet_request):
	Close the file handle here.
	* gnuserv.c (handle_unix_request):
	Don't close the file handle here, document why (it broke gnuclient
	under OS X). It should actually be OK, but my suspicion is that
	the issues is that the Unix (local) domain sockets are still
	underdocumented compared to the internet sockets.

diff -r e9bb3688e654 -r 1044acf60048 lib-src/ChangeLog
--- a/lib-src/ChangeLog	Wed Mar 04 15:54:00 2015 +0000
+++ b/lib-src/ChangeLog	Sun Mar 08 20:59:25 2015 +0000
@@ -1,3 +1,16 @@
+2015-03-08  Aidan Kehoe  <[email protected]>
+
+	* gnuserv.c (echo_request):
+	No longer close the file handle unconditionally, leave this to the
+	individual socket types.
+	* gnuserv.c (handle_internet_request):
+	Close the file handle here.
+	* gnuserv.c (handle_unix_request):
+	Don't close the file handle here, document why (it broke gnuclient
+	under OS X). It should actually be OK, but my suspicion is that
+	the issues is that the Unix (local) domain sockets are still
+	underdocumented compared to the internet sockets.
+
 2014-12-05  Jerry James  <[email protected]>
 
 	* gnuserv.c (echo_request): close the socket when done
diff -r e9bb3688e654 -r 1044acf60048 lib-src/gnuserv.c
--- a/lib-src/gnuserv.c	Wed Mar 04 15:54:00 2015 +0000
+++ b/lib-src/gnuserv.c	Sun Mar 08 20:59:25 2015 +0000
@@ -321,7 +321,6 @@
     exit(1);
   } /* if */
 
-  close(s);
 } /* echo_request */
 
 
@@ -754,6 +753,7 @@
 
   echo_request(s);
 
+  close(s); 
 } /* handle_internet_request */
 #endif /* INTERNET_DOMAIN_SOCKETS */
 
@@ -864,6 +864,14 @@
 
   echo_request(s);
 
+  /* Closing s here (or rather, within echo_request() with both
+     internet and local connections) meant gnuserv never returned
+     usefully under OS X, as of 20150308, reflecting changeset
+     https://bitbucket.org/xemacs/xemacs/commits/c03dd89 . Keeping it
+     open is not a significant security risk (it's a local connection,
+     with file system access restrictions) and given the practical
+     limitation on the number of handles gnuserv will keep around,
+     it's also not a significant resource issue. Leave it open.  */
 } /* handle_unix_request */
 #endif /* UNIX_DOMAIN_SOCKETS */
 


-- 
‘Tramadol is further fed to cattle […] when working them […] (as draft
animals) so that the animals do not get tired quickly. …’
	— Angewandte Chemie, Sept 2014, describing the social context of
	(synthetic) tramadol having been found in Cameroon tree roots.

_______________________________________________
XEmacs-Patches mailing list
[email protected]
http://lists.xemacs.org/mailman/listinfo/xemacs-patches