You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2016/12/06 12:47:28 UTC

svn commit: r1772886 - /tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java

Author: markt
Date: Tue Dec  6 12:47:28 2016
New Revision: 1772886

URL: http://svn.apache.org/viewvc?rev=1772886&view=rev
Log:
Refactor to better align APR and NIO/NIO2 Acceptor classes
- Re-use IOException handling during accept from NIO/NIO2 (it is slightly better)
- Align comments

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1772886&r1=1772885&r2=1772886&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Tue Dec  6 12:47:28 2016
@@ -960,12 +960,16 @@ public class AprEndpoint extends Abstrac
                                     Long.valueOf(addr.port)));
                         }
                     } catch (Exception e) {
-                        //we didn't get a socket
+                        // We didn't get a socket
                         countDownConnection();
-                        // Introduce delay if necessary
-                        errorDelay = handleExceptionWithDelay(errorDelay);
-                        // re-throw
-                        throw e;
+                        if (running) {
+                            // Introduce delay if necessary
+                            errorDelay = handleExceptionWithDelay(errorDelay);
+                            // re-throw
+                            throw e;
+                        } else {
+                            break;
+                        }
                     }
                     // Successful accept, reset the error delay
                     errorDelay = 0;
@@ -984,21 +988,19 @@ public class AprEndpoint extends Abstrac
                     }
                 } catch (Throwable t) {
                     ExceptionUtils.handleThrowable(t);
-                    if (running) {
-                        String msg = sm.getString("endpoint.accept.fail");
-                        if (t instanceof Error) {
-                            Error e = (Error) t;
-                            if (e.getError() == 233) {
-                                // Not an error on HP-UX so log as a warning
-                                // so it can be filtered out on that platform
-                                // See bug 50273
-                                log.warn(msg, t);
-                            } else {
-                                log.error(msg, t);
-                            }
+                    String msg = sm.getString("endpoint.accept.fail");
+                    if (t instanceof Error) {
+                        Error e = (Error) t;
+                        if (e.getError() == 233) {
+                            // Not an error on HP-UX so log as a warning
+                            // so it can be filtered out on that platform
+                            // See bug 50273
+                            log.warn(msg, t);
                         } else {
-                                log.error(msg, t);
+                            log.error(msg, t);
                         }
+                    } else {
+                            log.error(msg, t);
                     }
                 }
                 // The processor will recycle itself when it finishes



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