Hi,

I have found a small problem in src/c/jserv_ajpv12.c.
As the option SO_LINGER is not set to the socket the shutdown signal is
not received in our BS2000 machine.
I have found it because the argument -prof:/opt/apache/logs/java.prof of

JVM was not working, of course: The JVM was killed by the wrapper
process!

I have put a #define _OSD_POSIX but I think a piece of code is needed in

most plateforms, like the sock_enable_linger routine of
src/main/http_main.c (apache_1.3.12).
Please include the patch in CVS for the next JSERV release.

Regards

Jean-frederic CLERE



--- jserv_ajpv12.c.org  Fri Mar 31 18:03:23 2000
+++ jserv_ajpv12.c      Wed Jun 28 16:23:08 2000
@@ -65,6 +65,24 @@
  * Code for ajpv12
protocol                                                   *

*****************************************************************************/


+/* copy + paste from src/main/http_main.c" */
+#ifdef _OSD_POSIX
+#define MAX_SECS_TO_LINGER 30
+static void sock_enable_linger(jserv_config *cfg, int s)
+{
+    struct linger li;
+
+    li.l_onoff = 1;
+    li.l_linger = MAX_SECS_TO_LINGER;
+
+    if (setsockopt(s, SOL_SOCKET, SO_LINGER,
+                   (char *) &li, sizeof(struct linger)) < 0) {
+        jserv_error(JSERV_LOG_INFO,cfg,"ajp12:setsockopt:
(SO_LINGER)");
+        /* not a fatal error */
+    }
+}
+#endif
+
 /*
=========================================================================
*/
 /* Open a socket to JServ host */
 /* FIXME: short port gets overflowed - it's not unsigned */
@@ -122,6 +140,11 @@
         setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (char *)&set,
         sizeof(set));
     }
+#endif
+
+#ifdef _OSD_POSIX
+    /* otherwise the shutdown signal is not received */
+    sock_enable_linger(cfg, sock);
 #endif

     /* Return the socket number */



--
----------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to