remm 2005/04/15 09:06:30
Modified: util/java/org/apache/tomcat/util/net AprEndpoint.java
http11/src/java/org/apache/coyote/http11
Http11AprProcessor.java
Log:
- Some changes suggested by Mladen (but the poller still has an issue for me).
- Shorter property name.
Revision Changes Path
1.5 +19 -15
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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AprEndpoint.java 15 Apr 2005 15:49:32 -0000 1.4
+++ AprEndpoint.java 15 Apr 2005 16:06:30 -0000 1.5
@@ -246,9 +246,9 @@
/**
* Timeout on first request read before going to the poller, in ms.
*/
- protected int firstReadPollerTimeout = 100;
- public int getFirstReadPollerTimeout() { return firstReadPollerTimeout; }
- public void setFirstReadPollerTimeout(int firstReadPollerTimeout) {
this.firstReadPollerTimeout = firstReadPollerTimeout; }
+ protected int firstReadTimeout = 100;
+ public int getFirstReadTimeout() { return firstReadTimeout; }
+ public void setFirstReadTimeout(int firstReadTimeout) {
this.firstReadTimeout = firstReadTimeout; }
/**
@@ -696,6 +696,8 @@
protected long pool = 0;
protected long[] desc;
protected long[] sockets;
+ protected long[] events;
+ protected long[] pools;
public Poller(int size) {
pool = Pool.create(serverSockPool);
@@ -707,6 +709,8 @@
}
desc = new long[size];
sockets = new long[size];
+ events = new long[size];
+ pools = new long[size];
}
public synchronized void add(long socket, long pool) {
@@ -755,28 +759,28 @@
if (rv > 0) {
synchronized (this) {
for (int n = 0; n < rv; n++) {
- // Remove each socket from the poll right
away
sockets[n] = Poll.socket(desc[n]);
+ // Get the socket pool
+ pools[n] = Poll.data(desc[n]);
+ // Get retuned events for this socket
+ events[n] = Poll.events(desc[n]);
+ // Remove each socket from the poll right
away
remove(sockets[n]);
}
}
for (int n = 0; n < rv; n++) {
- // Get the socket pool
- int pool = (int) Poll.data(desc[n]);
- // Get retuned events for this socket
- int events = Poll.events(desc[n]);
- //System.out.println("Events: " + sockets[n] + "
code: " + events + " OK: " + Poll.APR_POLLIN);
+ //System.out.println("Events: " + sockets[n] + "
code: " + events[n] + " OK: " + Poll.APR_POLLIN);
// Problem events
- if (((events & Poll.APR_POLLHUP) ==
Poll.APR_POLLHUP)
- || ((events & Poll.APR_POLLERR) ==
Poll.APR_POLLERR)) {
+ if (((events[n] & Poll.APR_POLLHUP) ==
Poll.APR_POLLHUP)
+ || ((events[n] & Poll.APR_POLLERR) ==
Poll.APR_POLLERR)) {
// Close socket and clear pool
- Pool.destroy(pool);
+ Pool.destroy(pools[n]);
continue;
}
// Anything non normal
- if (!((events & Poll.APR_POLLIN) ==
Poll.APR_POLLIN)) {
+ if (!((events[n] & Poll.APR_POLLIN) ==
Poll.APR_POLLIN)) {
// Close socket and clear pool
- Pool.destroy(pool);
+ Pool.destroy(pools[n]);
continue;
}
// Allocate a new worker thread
@@ -796,7 +800,7 @@
}
// Hand this socket off to an appropriate
processor
//System.out.println("Process: " + sockets[n]);
- workerThread.assign(sockets[n], pool);
+ workerThread.assign(sockets[n], pools[n]);
}
}
} catch (Throwable t) {
1.4 +1 -1
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
Index: Http11AprProcessor.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Http11AprProcessor.java 15 Apr 2005 15:49:33 -0000 1.3
+++ Http11AprProcessor.java 15 Apr 2005 16:06:30 -0000 1.4
@@ -76,7 +76,7 @@
request = new Request();
inputBuffer = new InternalAprInputBuffer(request, headerBufferSize,
- endpoint.getFirstReadPollerTimeout());
+ endpoint.getFirstReadTimeout());
request.setInputBuffer(inputBuffer);
response = new Response();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]