remm 2005/06/14 06:14:19
Modified: util/java/org/apache/tomcat/util/net/res
LocalStrings.properties
util/java/org/apache/tomcat/util/net AprEndpoint.java
Log:
- Add status codes on errors.
- Close remaining sockets on destroy.
Revision Changes Path
1.10 +1 -1
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/res/LocalStrings.properties
Index: LocalStrings.properties
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/res/LocalStrings.properties,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- LocalStrings.properties 14 May 2005 15:42:30 -0000 1.9
+++ LocalStrings.properties 14 Jun 2005 13:14:18 -0000 1.10
@@ -15,7 +15,7 @@
endpoint.accept.fail=Socket accept failed
endpoint.poll.limitedpollsize=Failed to create poller with specified size,
uses 62 instead
endpoint.poll.initfail=Poller creation failed
-endpoint.poll.fail=Critical poller failure, restarting poller
+endpoint.poll.fail=Critical poller failure ({0}), restarting poller
endpoint.poll.error=Unexpected poller error
endpoint.sendfile.error=Unexpected sendfile error
endpoint.sendfile.addfail=Sednfile failure with status {0}
1.45 +25 -4
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java
Index: AprEndpoint.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- AprEndpoint.java 14 Jun 2005 08:23:25 -0000 1.44
+++ AprEndpoint.java 14 Jun 2005 13:14:19 -0000 1.45
@@ -796,11 +796,20 @@
* Destroy the poller.
*/
protected void destroy() {
- /* Remove the sockets in the add queue */
+ // Close all sockets in the add queue
for (int i = 0; i < addCount; i--) {
Pool.destroy(addP[i]);
}
+ // Close all sockets still in the poller
+ int rv = Poll.pollset(serverPollset, desc);
+ if (rv > 0) {
+ for (int n = 0; n < rv; n++) {
+ Pool.destroy(desc[n*4+2]);
+ }
+ }
Pool.destroy(pool);
+ keepAliveCount = 0;
+ addCount = 0;
}
/**
@@ -895,7 +904,7 @@
} else if (rv < 0) {
/* Any non timeup error is critical */
if (-rv != Status.TIMEUP) {
- log.error(sm.getString("endpoint.poll.fail"));
+ log.error(sm.getString("endpoint.poll.fail",
Error.strerror(-rv)));
// Handle poll critical failure
synchronized (this) {
destroy();
@@ -1113,8 +1122,20 @@
* Destroy the poller.
*/
protected void destroy() {
- sendfileData.clear();
+ // Close any socket remaining in the add queue
+ for (int i = (addS.size() - 1); i >= 0; i--) {
+ SendfileData data = (SendfileData) addS.get(i);
+ Pool.destroy(data.pool);
+ }
+ // Close all sockets still in the poller
+ int rv = Poll.pollset(sendfilePollset, desc);
+ if (rv > 0) {
+ for (int n = 0; n < rv; n++) {
+ Pool.destroy(desc[n*4+2]);
+ }
+ }
Pool.destroy(pool);
+ sendfileData.clear();
}
/**
@@ -1281,7 +1302,7 @@
if (-rv == Status.TIMEUP)
rv = 0;
else {
- log.error(sm.getString("endpoint.poll.fail"));
+ log.error(sm.getString("endpoint.poll.fail",
Error.strerror(-rv)));
// Handle poll critical failure
synchronized (this) {
destroy();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]