Author: fhanik
Date: Tue Dec 23 18:57:14 2008
New Revision: 729202

URL: http://svn.apache.org/viewvc?rev=729202&view=rev
Log:
commit approved fix

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=729202&r1=729201&r2=729202&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Dec 23 18:57:14 2008
@@ -174,11 +174,6 @@
    0: remm (risky, would it be possible to stop backporting risky changes and 
behavior modifications to 6.0.x ?)
   -1: 
 
-* Fix possible NPE in NioEndpoint
-  http://svn.apache.org/viewvc?rev=719096&view=rev
-  +1: fhanik, markt, pero
-  -1: 
-
 * Fix send file bug
   http://svn.apache.org/viewvc?rev=719129&view=rev
   +1: fhanik, pero

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=729202&r1=729201&r2=729202&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Tue 
Dec 23 18:57:14 2008
@@ -1426,7 +1426,8 @@
                         processSocket(ka.getChannel(), status, false); //don't 
dispatch if the lines below are cancelling the key
                     }                    
                 }
-                handler.release(ka.getChannel());
+                
+                if (ka!=null) handler.release(ka.getChannel());
                 if (key.isValid()) key.cancel();
                 if (key.channel().isOpen()) try {key.channel().close();}catch 
(Exception ignore){}
                 try {ka.channel.close(true);}catch (Exception ignore){}
@@ -1606,13 +1607,26 @@
                     sd.length -= written;
                 }
                 if ( sd.length <= 0 ) {
+                    if (log.isDebugEnabled()) {
+                        log.debug("Send file complete for:"+sd.fileName);
+                    }
                     attachment.setSendfileData(null);
                     if ( sd.keepAlive ) {
+                        if (log.isDebugEnabled()) {
+                            log.debug("Connection is keep alive, registering 
back for OP_READ");
+                        }
                         if (reg) reg(sk,attachment,SelectionKey.OP_READ);
                     } else {
+                        if (log.isDebugEnabled()) {
+                            log.debug("Send file connection is being closed");
+                        }
                         cancelledKey(sk,SocketStatus.STOP,false);
                     }
                 } else if ( attachment.interestOps() == 0 && reg ) {
+                    if (log.isDebugEnabled()) {
+                        log.debug("OP_WRITE for sendilfe:"+sd.fileName);
+                    }
+
                     reg(sk,attachment,SelectionKey.OP_WRITE);
                 }
             }catch ( IOException x ) {

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=729202&r1=729201&r2=729202&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Tue Dec 23 18:57:14 2008
@@ -207,6 +207,9 @@
   <subsection name="Coyote">
     <changelog>
       <update>
+        Fix possible NPE in NioEndpoint.java (fhanik)
+      </update>
+      <update>
         Update tc-native to 1.1.15 in build.properties.default (jfclere)
       </update>
       <fix>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to