costin      02/04/25 15:04:00

  Modified:    jk/java/org/apache/jk/common ChannelUn.java Shm.java
  Log:
  Extra checks for APR presence.
  
  Revision  Changes    Path
  1.16      +3 -0      
jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelUn.java
  
  Index: ChannelUn.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelUn.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ChannelUn.java    25 Apr 2002 18:24:18 -0000      1.15
  +++ ChannelUn.java    25 Apr 2002 22:04:00 -0000      1.16
  @@ -176,11 +176,13 @@
   
       
       public void close(MsgContext ep) throws IOException {
  +        if( apr==null ) return;
           Long s=(Long)ep.getNote( socketNote );
           apr.unSocketClose(gPool, s.longValue(),3);
       }
   
       public void destroy() throws IOException {
  +        if( apr==null ) return;
           try {
               if( tp != null )
                   tp.shutdown();
  @@ -315,6 +317,7 @@
       void acceptConnections() {
           if( log.isDebugEnabled() )
               log.debug("Accepting ajp connections on " + file);
  +        if( apr==null ) return;
           while( running ) {
               try {
                   MsgContext ep=new MsgContext();
  
  
  
  1.5       +5 -0      jakarta-tomcat-connectors/jk/java/org/apache/jk/common/Shm.java
  
  Index: Shm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/Shm.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Shm.java  25 Apr 2002 18:25:49 -0000      1.4
  +++ Shm.java  25 Apr 2002 22:04:00 -0000      1.5
  @@ -102,6 +102,7 @@
   
       public void init() throws IOException {
           super.initNative( "shm" );
  +        if( apr==null ) return;
           if( file==null ) {
               log.error("No shm file, disabling shared memory");
               apr=null;
  @@ -116,6 +117,7 @@
       }
   
       public void attach() throws IOException {
  +        if( apr==null ) return;
           MsgContext mCtx=createMsgContext();
           Msg msg=(Msg)mCtx.getMsg(0);
           msg.reset();
  @@ -126,6 +128,7 @@
       }
   
       public void setNativeAttribute(String name, String val) throws IOException {
  +        if( apr==null ) return;
           MsgContext mCtx=createMsgContext();
           Msg msg=(Msg)mCtx.getMsg(0);
           C2BConverter c2b=(C2BConverter)mCtx.getNote(C2B_NOTE);
  @@ -143,6 +146,7 @@
       public void registerTomcat(String host, int port)
           throws IOException
       {
  +        if( apr==null ) return;
           MsgContext mCtx=createMsgContext();
           Msg msg=(Msg)mCtx.getMsg(0);
           msg.reset();
  @@ -172,6 +176,7 @@
       public  int invoke(Msg msg, MsgContext ep )
           throws IOException
       {
  +        if( apr==null ) return;
           System.err.println("ChannelShm.invoke: "  + ep );
           super.nativeDispatch( msg, ep, JK_HANDLE_SHM_DISPATCH );
           return 0;
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to