You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fh...@apache.org on 2012/05/18 21:28:30 UTC

svn commit: r1340218 - in /tomcat/tc7.0.x/trunk: java/org/apache/tomcat/util/net/NioEndpoint.java webapps/docs/changelog.xml

Author: fhanik
Date: Fri May 18 19:28:30 2012
New Revision: 1340218

URL: http://svn.apache.org/viewvc?rev=1340218&view=rev
Log:
Fix 
https://issues.apache.org/bugzilla/show_bug.cgi?id=53138
https://issues.apache.org/bugzilla/show_bug.cgi?id=52858


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

Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1340218&r1=1340217&r2=1340218&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Fri May 18 19:28:30 2012
@@ -1278,9 +1278,13 @@ public class NioEndpoint extends Abstrac
 
         public boolean processSendfile(SelectionKey sk, KeyAttachment attachment, boolean reg, boolean event) {
             NioChannel sc = null;
+            if (log.isTraceEnabled()) {
+                log.trace("["+new java.sql.Date(System.currentTimeMillis()).toGMTString()+"] Processing send file. ["+sk+"] ");
+            }
             try {
                 unreg(sk, attachment, sk.readyOps());
                 SendfileData sd = attachment.getSendfileData();
+                //setup the file channel
                 if ( sd.fchannel == null ) {
                     File f = new File(sd.fileName);
                     if ( !f.exists() ) {
@@ -1289,10 +1293,14 @@ public class NioEndpoint extends Abstrac
                     }
                     sd.fchannel = new FileInputStream(f).getChannel();
                 }
+
+                //configure output channel
                 sc = attachment.getChannel();
                 sc.setSendFile(true);
+                //ssl channel is slightly different
                 WritableByteChannel wc = ((sc instanceof SecureNioChannel)?sc:sc.getIOChannel());
 
+                //we still have data in the buffer
                 if (sc.getOutboundRemaining()>0) {
                     if (sc.flushOutbound()) {
                         attachment.access();
@@ -1322,7 +1330,6 @@ public class NioEndpoint extends Abstrac
                     } catch (Exception ignore) {
                     }
                     if ( sd.keepAlive ) {
-                        if (reg) {
                             if (log.isDebugEnabled()) {
                                 log.debug("Connection is keep alive, registering back for OP_READ");
                             }
@@ -1331,7 +1338,6 @@ public class NioEndpoint extends Abstrac
                             } else {
                                 reg(sk,attachment,SelectionKey.OP_READ);
                             }
-                        }
                     } else {
                         if (log.isDebugEnabled()) {
                             log.debug("Send file connection is being closed");
@@ -1339,7 +1345,7 @@ public class NioEndpoint extends Abstrac
                         cancelledKey(sk,SocketStatus.STOP,false);
                         return false;
                     }
-                } else if ( attachment.interestOps() == 0 && reg ) {
+                } else { //if ( attachment.interestOps() == 0 && reg ) {
                     if (log.isDebugEnabled()) {
                         log.debug("OP_WRITE for sendilfe:"+sd.fileName);
                     }

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1340218&r1=1340217&r2=1340218&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Fri May 18 19:28:30 2012
@@ -117,6 +117,14 @@
   <subsection name="Coyote">
     <changelog>
       <fix>
+        <bug>52858</bug>: Correct fix for high CPU load
+        (fhanik)
+      </fix>
+      <fix>
+        <bug>53138</bug>: Broken Sendfile on SSL introduced in 7.0.27
+        (fhanik)
+      </fix>
+      <fix>
         <bug>52055</bug>: Additional fix required to ensure that
         <code>InputFilter</code>s are recycled between requests. (markt)
       </fix>



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