From: fhanik Date: Wed, 24 Dec 2008 01:57:36 +0000 (+0000) Subject: Fix file descriptor leak X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f85a00f846e8cfcd2315ccbdb0c1c37fafc1c3b4;p=tomcat7.0 Fix file descriptor leak git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@729191 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 08b38db28..bc95a578f 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -1401,6 +1401,7 @@ public class NioEndpoint { 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 @@ public class NioEndpoint { 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()) {