2015-07-03 0:07 GMT+03:00 <ma...@apache.org>: > Author: markt > Date: Thu Jul 2 21:07:18 2015 > New Revision: 1688911 > > URL: http://svn.apache.org/r1688911 > Log: (empty)
Log message =? This looks like a followup to http://svn.apache.org/r1688909 Removing "ka = null;" line has no effect, as "ka" variable is not used below. OK with it. Removing "socket = null;" line has an effect on catch(OutOfMemoryError) clause. An unlikely use case, though. If we keep the "socket = null;" line , it can be moved into the close() method. Note that it will be "this.socket = null;" there, as socket argument of the close() method shadows socket field of the class. > - if (socket.getPoller().cancelledKey(key, SocketStatus.ERROR, > false) != null) { > + if (socket.getPoller().cancelledKey(key, socketStatus, > false) != null) { OK. The above was a copy-paste fix from extracting common code into as method in r1688909. The error was that socketStatus argument was not used. Best regards, Konstantin Kolinko > Modified: > tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java > > 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=1688911&r1=1688910&r2=1688911&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 Thu > Jul 2 21:07:18 2015 > @@ -1756,20 +1756,17 @@ public class NioEndpoint extends Abstrac > // Close socket and pool > try { > close(ka, socket, key, SocketStatus.ERROR); > - socket = null; > - ka = null; > } catch ( Exception x ) { > log.error("",x); > } > } > } else if (handshake == -1 ) { > close(ka, socket, key, SocketStatus.DISCONNECT); > - ka = null; > } else { > ka.getPoller().add(socket, handshake); > } > - }catch(CancelledKeyException cx) { > - socket.getPoller().cancelledKey(key,null,false); > + } catch (CancelledKeyException cx) { > + socket.getPoller().cancelledKey(key, null, false); > } catch (OutOfMemoryError oom) { > try { > oomParachuteData = null; > @@ -1809,7 +1806,7 @@ public class NioEndpoint extends Abstrac > if (ka != null) { > ka.setComet(false); > } > - if (socket.getPoller().cancelledKey(key, SocketStatus.ERROR, > false) != null) { > + if (socket.getPoller().cancelledKey(key, socketStatus, > false) != null) { > // SocketWrapper (attachment) was removed from the > // key - recycle both. This can only happen once > // per attempted closure so it is used to determine > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org