remm 2005/04/15 10:19:52 Modified: util/java/org/apache/tomcat/util/net AprEndpoint.java http11/src/java/org/apache/coyote/http11 InternalAprInputBuffer.java Log: - Fixed keepalive handling (so it works *and* it runs fast). Revision Changes Path 1.7 +1 -18 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.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- AprEndpoint.java 15 Apr 2005 16:37:39 -0000 1.6 +++ AprEndpoint.java 15 Apr 2005 17:19:52 -0000 1.7 @@ -773,21 +773,12 @@ // Get the socket pool pools[n] = Poll.data(desc[n]); // Get retuned events for this socket - //events[n] = Poll.events(desc[n]); + events[n] = Poll.events(desc[n]); // Remove each socket from the poll right away remove(sockets[n]); } } for (int n = 0; n < rv; n++) { - // Check the health of the socket - int res = Socket.recvt(sockets[n], null, 0, 0, 0); - //System.out.println("Events: " + sockets[n] + " code: " + events[n] + " res: " + res); - if (res < 0) { - // Close socket and clear pool - Pool.destroy(pools[n]); - continue; - } - /* // Problem events if (((events[n] & Poll.APR_POLLHUP) == Poll.APR_POLLHUP) || ((events[n] & Poll.APR_POLLERR) == Poll.APR_POLLERR)) { @@ -795,15 +786,7 @@ Pool.destroy(pools[n]); continue; } - // Anything non normal - if (!((events[n] & Poll.APR_POLLIN) == Poll.APR_POLLIN)) { - // Close socket and clear pool - Pool.destroy(pools[n]); - continue; - } - */ // Hand this socket off to a worker - //System.out.println("Process: " + sockets[n]); getWorkerThread().assign(sockets[n], pools[n]); } } 1.5 +10 -2 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalAprInputBuffer.java Index: InternalAprInputBuffer.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalAprInputBuffer.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- InternalAprInputBuffer.java 15 Apr 2005 15:49:33 -0000 1.4 +++ InternalAprInputBuffer.java 15 Apr 2005 17:19:52 -0000 1.5 @@ -398,7 +398,11 @@ if (nRead > 0) { lastValid = pos + nRead; } else { - return false; + if (Status.APR_STATUS_IS_ETIMEDOUT(-nRead)) { + return false; + } else { + throw new IOException(sm.getString("iib.failedread")); + } } } @@ -418,7 +422,11 @@ if (nRead > 0) { lastValid = pos + nRead; } else { - return false; + if (Status.APR_STATUS_IS_ETIMEDOUT(-nRead)) { + return false; + } else { + throw new IOException(sm.getString("iib.failedread")); + } } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]