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 2008/12/24 02:57:36 UTC
svn commit: r729191 -
/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
Author: fhanik
Date: Tue Dec 23 17:57:36 2008
New Revision: 729191
URL: http://svn.apache.org/viewvc?rev=729191&view=rev
Log:
Fix file descriptor leak
Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=729191&r1=729190&r2=729191&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Tue Dec 23 17:57:36 2008
@@ -1401,6 +1401,7 @@
if (key.isValid()) key.cancel();
if (key.channel().isOpen()) try {key.channel().close();}catch (Exception ignore){}
try {if (ka!=null) ka.channel.close(true);}catch (Exception ignore){}
+ try {if (ka!=null && ka.getSendfileData()!=null && ka.getSendfileData().fchannel!=null && ka.getSendfileData().fchannel.isOpen()) ka.getSendfileData().fchannel.close();}catch (Exception ignore){}
if (ka!=null) ka.reset();
} catch (Throwable e) {
if ( log.isDebugEnabled() ) log.error("",e);
@@ -1594,6 +1595,7 @@
log.debug("Send file complete for:"+sd.fileName);
}
attachment.setSendfileData(null);
+ try {sd.fchannel.close();}catch(Exception ignore){}
if ( sd.keepAlive ) {
if (reg) {
if (log.isDebugEnabled()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org