tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1366961 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java webapps/docs/changelog.xml
Date Sun, 29 Jul 2012 21:51:07 GMT
Author: markt
Date: Sun Jul 29 21:51:06 2012
New Revision: 1366961

URL: http://svn.apache.org/viewvc?rev=1366961&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53606
Fix possible NPE when sending pings between cluster nodes
Based on a patch by F.Arnoud

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1366959

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java?rev=1366961&r1=1366960&r2=1366961&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java
Sun Jul 29 21:51:06 2012
@@ -122,13 +122,17 @@ public class TcpPingInterceptor extends 
     }
 
     protected void sendPing() {
-        if (failureDetector.get()!=null) {
-            //we have a reference to the failure detector
-            //piggy back on that dude
-            failureDetector.get().checkMembers(true);
-        }else {
-            if (staticOnly && staticMembers.get()!=null) {
-                sendPingMessage(staticMembers.get().getMembers());
+        TcpFailureDetector tcpFailureDetector =
+                failureDetector != null ? failureDetector.get() : null;
+        if (tcpFailureDetector != null) {
+            // We have a reference to the failure detector
+            // Piggy back on it
+            tcpFailureDetector.checkMembers(true);
+        } else {
+            StaticMembershipInterceptor smi =
+                    staticOnly && staticMembers != null ? staticMembers.get() : null;
+            if (smi != null) {
+                sendPingMessage(smi.getMembers());
             } else {
                 sendPingMessage(getMembers());
             }

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=1366961&r1=1366960&r2=1366961&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sun Jul 29 21:51:06 2012
@@ -138,6 +138,10 @@
         Avoid potential NPE identified by Find Bugs in
         <code>org.apache.catalina.tribes.io.ReplicationStream</code>. (markt)
       </fix>
+      <fix>
+        <bug>53606</bug>: Fix potential NPE in <code>TcpPingInterceptor</code>.
+        Based on a patch by F. Arnoud. (markt)
+      </fix>
     </changelog>
   </subsection>
 </section>



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


Mime
View raw message