JBossWeb SVN: r473 - trunk/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-03-05 13:32:31 -0500 (Wed, 05 Mar 2008)
New Revision: 473
Modified:
trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
Log:
- Fix a glitch in flushLeftover, which probably does not happen in the real world.
- Cleanup.
Modified: trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
===================================================================
--- trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2008-03-05 17:02:58 UTC (rev 472)
+++ trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2008-03-05 18:32:31 UTC (rev 473)
@@ -743,16 +743,19 @@
}
//System.out.println("Flushed leftover " + res);
response.setLastWrite(res);
- bbuf.clear();
if (pos < end) {
// Could not write all leftover data: put back to write poller
- leftover.setOffset(start + pos);
+ leftover.setOffset(start);
+ bbuf.position(pos);
return false;
+ } else {
+ bbuf.clear();
}
}
if (thisTime > bbuf.capacity() - bbuf.position()) {
thisTime = bbuf.capacity() - bbuf.position();
}
+ //System.out.println("Put " + thisTime + " bytes from leftover");
bbuf.put(b, start, thisTime);
len = len - thisTime;
start = start + thisTime;
@@ -810,9 +813,10 @@
res = Socket.send(socket, leftover.getBuffer(), leftover.getOffset(), leftover.getEnd());
leftover.recycle();
// Send current buffer
- if (res > 0) {
+ if (res > 0 && bbuf.position() > 0) {
res = Socket.sendbb(socket, 0, bbuf.position());
}
+ bbuf.clear();
Socket.timeoutSet(socket, 0);
} else {
throw new IOException("Backlog");
@@ -826,7 +830,7 @@
int pos = 0;
int end = bbuf.position();
while (pos < end) {
- res = Socket.sendibb(socket, pos, bbuf.position());
+ res = Socket.sendibb(socket, pos, end);
//if (res == 0) System.out.println("Wrote 0 bytes");
if (res > 0) {
pos += res;
@@ -840,7 +844,7 @@
//System.out.println("Blocking write of all data");
// Switch to blocking mode and write the data
Socket.timeoutSet(socket, endpoint.getSoTimeout() * 1000);
- res = Socket.sendbb(socket, 0, bbuf.position());
+ res = Socket.sendbb(socket, 0, end);
Socket.timeoutSet(socket, 0);
} else {
// Put any leftover bytes in the leftover byte chunk
16 years, 2 months
JBossWeb SVN: r472 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-03-05 12:02:58 -0500 (Wed, 05 Mar 2008)
New Revision: 472
Modified:
trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
trunk/webapps/docs/changelog.xml
Log:
- Port access log fix for query string.
Modified: trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
===================================================================
--- trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java 2008-03-05 16:04:41 UTC (rev 471)
+++ trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java 2008-03-05 17:02:58 UTC (rev 472)
@@ -663,7 +663,7 @@
public void addElement(StringBuffer buf, Date date,
Request request, Response response, long time) {
String query = request.getQueryString();
- if (query != null) {
+ if (query == null) {
buf.append(request.getRequestURI());
} else {
buf.append(request.getRequestURI());
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-03-05 16:04:41 UTC (rev 471)
+++ trunk/webapps/docs/changelog.xml 2008-03-05 17:02:58 UTC (rev 472)
@@ -154,6 +154,9 @@
<fix>
Avoid verbose exception with empty URLs. (markt)
</fix>
+ <fix>
+ ExtendedAccessLogValve cs-uri not print empty querystring (pero)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
16 years, 2 months
JBossWeb SVN: r471 - trunk/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-03-05 11:04:41 -0500 (Wed, 05 Mar 2008)
New Revision: 471
Modified:
trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
Log:
- Fix same data corruption bug in the other place where the same algorithm is used.
- Comment out all sys.outs.
Modified: trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
===================================================================
--- trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2008-03-05 15:44:28 UTC (rev 470)
+++ trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2008-03-05 16:04:41 UTC (rev 471)
@@ -741,7 +741,7 @@
if (res < 0) {
throw new IOException("Error");
}
- System.out.println("Flushed leftover " + res);
+ //System.out.println("Flushed leftover " + res);
response.setLastWrite(res);
bbuf.clear();
if (pos < end) {
@@ -763,7 +763,7 @@
int res = 0;
while (pos < end) {
res = Socket.sendibb(socket, pos, bbuf.position());
- System.out.println("Write from main buffer " + res);
+ //System.out.println("Write from main buffer " + res);
if (res > 0) {
pos += res;
} else {
@@ -776,8 +776,8 @@
response.setLastWrite(res);
if (pos < end) {
leftover.allocate(end - pos, -1);
- bbuf.position(0);
- bbuf.limit(end - pos);
+ bbuf.position(pos);
+ bbuf.limit(end);
bbuf.get(leftover.getBuffer(), 0, end - pos);
leftover.setEnd(end - pos);
bbuf.clear();
@@ -802,9 +802,9 @@
// - If the call is asynchronous, throw an exception
// - If the call is synchronous, make a regular blocking write to flush the data
if (leftover.getLength() > 0) {
- System.out.println("Leftovers present");
+ //System.out.println("Leftovers present");
if (Http11AprProcessor.containerThread.get() == Boolean.TRUE) {
- System.out.println("Send leftovers using blocking");
+ //System.out.println("Send leftovers using blocking");
Socket.timeoutSet(socket, endpoint.getSoTimeout() * 1000);
// Send leftover bytes
res = Socket.send(socket, leftover.getBuffer(), leftover.getOffset(), leftover.getEnd());
@@ -827,21 +827,17 @@
int end = bbuf.position();
while (pos < end) {
res = Socket.sendibb(socket, pos, bbuf.position());
- if (res == 0) {
- System.out.println("Wrote 0 bytes");
- }
+ //if (res == 0) System.out.println("Wrote 0 bytes");
if (res > 0) {
pos += res;
} else {
break;
}
- if (pos < end) {
- System.out.println("Wrote: " + pos + " of " + end);
- }
+ //if (pos < end) System.out.println("Wrote: " + pos + " of " + end);
}
if (pos < end) {
if (response.getFlushLeftovers() && (Http11AprProcessor.containerThread.get() == Boolean.TRUE)) {
- System.out.println("Blocking write of all data");
+ //System.out.println("Blocking write of all data");
// Switch to blocking mode and write the data
Socket.timeoutSet(socket, endpoint.getSoTimeout() * 1000);
res = Socket.sendbb(socket, 0, bbuf.position());
@@ -853,7 +849,7 @@
bbuf.limit(end);
bbuf.get(leftover.getBuffer(), 0, end - pos);
leftover.setEnd(end - pos);
- System.out.println("Put " + (end-pos) + " bytes in leftover: " + new String(leftover.getBuffer(), 0, end - pos) + " l:" + leftover.getBuffer().length);
+ //System.out.println("Put " + (end-pos) + " bytes in leftover: " + new String(leftover.getBuffer(), 0, end - pos) + " l:" + leftover.getBuffer().length);
// Call for a write event because it is possible that no further write
// operations are made
if (!response.getFlushLeftovers()) {
@@ -896,7 +892,7 @@
// part of the same write operation)
if (leftover.getLength() > 0) {
leftover.append(chunk);
- System.out.println("Add chunk to leftover: " + chunk.getLength());
+ //System.out.println("Add chunk to leftover: " + chunk.getLength());
return chunk.getLength();
}
16 years, 2 months
JBossWeb SVN: r470 - trunk/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-03-05 10:44:28 -0500 (Wed, 05 Mar 2008)
New Revision: 470
Modified:
trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
Log:
- Fix two bugs: data corruption (not putting the right data in the leftover chunk), and forgetting
to empty the buffer after writing leftover data.
Modified: trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
===================================================================
--- trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2008-03-05 13:24:35 UTC (rev 469)
+++ trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2008-03-05 15:44:28 UTC (rev 470)
@@ -743,10 +743,10 @@
}
System.out.println("Flushed leftover " + res);
response.setLastWrite(res);
+ bbuf.clear();
if (pos < end) {
// Could not write all leftover data: put back to write poller
leftover.setOffset(start + pos);
- bbuf.clear();
return false;
}
}
@@ -849,8 +849,8 @@
} else {
// Put any leftover bytes in the leftover byte chunk
leftover.allocate(end - pos, -1);
- bbuf.position(0);
- bbuf.limit(end - pos);
+ bbuf.position(pos);
+ bbuf.limit(end);
bbuf.get(leftover.getBuffer(), 0, end - pos);
leftover.setEnd(end - pos);
System.out.println("Put " + (end-pos) + " bytes in leftover: " + new String(leftover.getBuffer(), 0, end - pos) + " l:" + leftover.getBuffer().length);
@@ -896,7 +896,7 @@
// part of the same write operation)
if (leftover.getLength() > 0) {
leftover.append(chunk);
- System.out.println("Add chunk to leftover");
+ System.out.println("Add chunk to leftover: " + chunk.getLength());
return chunk.getLength();
}
16 years, 2 months
JBossWeb SVN: r469 - trunk/res.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-03-05 08:24:35 -0500 (Wed, 05 Mar 2008)
New Revision: 469
Modified:
trunk/res/header.bmp
trunk/res/side_left.bmp
Log:
- Redo (badly) the two bitmaps.
Modified: trunk/res/header.bmp
===================================================================
(Binary files differ)
Modified: trunk/res/side_left.bmp
===================================================================
(Binary files differ)
16 years, 2 months
JBossWeb SVN: r468 - trunk/java/org/apache/catalina/connector.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-03-05 07:44:07 -0500 (Wed, 05 Mar 2008)
New Revision: 468
Modified:
trunk/java/org/apache/catalina/connector/InputBuffer.java
Log:
- Do exception wrapping for reads too (to cleanup logging).
Modified: trunk/java/org/apache/catalina/connector/InputBuffer.java
===================================================================
--- trunk/java/org/apache/catalina/connector/InputBuffer.java 2008-03-04 23:42:05 UTC (rev 467)
+++ trunk/java/org/apache/catalina/connector/InputBuffer.java 2008-03-05 12:44:07 UTC (rev 468)
@@ -320,10 +320,16 @@
if(state == INITIAL_STATE)
state = BYTE_STATE;
- int result = coyoteRequest.doRead(bb);
+ try {
+ return coyoteRequest.doRead(bb);
+ } catch (IOException e) {
+ // An IOException on a read is almost always due to
+ // the remote client aborting the request or a timeout occurring.
+ // Wrap this so that it can be handled better by the error
+ // dispatcher.
+ throw new ClientAbortException(e);
+ }
- return result;
-
}
16 years, 2 months
JBossWeb SVN: r467 - trunk/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-03-04 18:42:05 -0500 (Tue, 04 Mar 2008)
New Revision: 467
Modified:
trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
Log:
- Remove useless sys.outs as non blocking writes seem to mostly work. Add debug to show partial writes.
Modified: trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
===================================================================
--- trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2008-03-04 17:35:40 UTC (rev 466)
+++ trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2008-03-04 23:42:05 UTC (rev 467)
@@ -821,20 +821,23 @@
if (bbuf.position() > 0) {
if (nonBlocking) {
- System.out.println("No leftovers present");
// Perform non blocking writes until all data is written, or the result
// of the write is 0
int pos = 0;
int end = bbuf.position();
while (pos < end) {
- // FIXME: temp testing
- //res = 0;
res = Socket.sendibb(socket, pos, bbuf.position());
+ if (res == 0) {
+ System.out.println("Wrote 0 bytes");
+ }
if (res > 0) {
pos += res;
} else {
break;
}
+ if (pos < end) {
+ System.out.println("Wrote: " + pos + " of " + end);
+ }
}
if (pos < end) {
if (response.getFlushLeftovers() && (Http11AprProcessor.containerThread.get() == Boolean.TRUE)) {
16 years, 2 months
JBossWeb SVN: r466 - trunk/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-03-04 12:35:40 -0500 (Tue, 04 Mar 2008)
New Revision: 466
Modified:
trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java
trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
Log:
- Jean-Fr?\195?\169d?\195?\169ric determined it would be best to stick to only using the timeout value (set to 0) to
switch to non blocking.
- Also use sensible timeout values.
Modified: trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2008-03-04 15:39:25 UTC (rev 465)
+++ trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2008-03-04 17:35:40 UTC (rev 466)
@@ -87,12 +87,12 @@
this.endpoint = endpoint;
request = new Request();
- inputBuffer = new InternalAprInputBuffer(request, headerBufferSize);
+ inputBuffer = new InternalAprInputBuffer(request, headerBufferSize, endpoint);
request.setInputBuffer(inputBuffer);
response = new Response();
response.setHook(this);
- outputBuffer = new InternalAprOutputBuffer(response, headerBufferSize);
+ outputBuffer = new InternalAprOutputBuffer(response, headerBufferSize, endpoint);
response.setOutputBuffer(outputBuffer);
request.setResponse(response);
@@ -1272,15 +1272,13 @@
} else if (actionCode == ActionCode.ACTION_COMET_BEGIN) {
comet = true;
// Set socket to non blocking mode
- Socket.optSet(socket, Socket.APR_SO_NONBLOCK, 1);
Socket.timeoutSet(socket, 0);
outputBuffer.setNonBlocking(true);
inputBuffer.setNonBlocking(true);
} else if (actionCode == ActionCode.ACTION_COMET_END) {
comet = false;
// End non blocking mode
- Socket.optSet(socket, Socket.APR_SO_NONBLOCK, 0);
- Socket.timeoutSet(socket, endpoint.getSoTimeout());
+ Socket.timeoutSet(socket, endpoint.getSoTimeout() * 1000);
outputBuffer.setNonBlocking(false);
inputBuffer.setNonBlocking(false);
} else if (actionCode == ActionCode.ACTION_COMET_SUSPEND) {
Modified: trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java
===================================================================
--- trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java 2008-03-04 15:39:25 UTC (rev 465)
+++ trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java 2008-03-04 17:35:40 UTC (rev 466)
@@ -28,6 +28,7 @@
import org.apache.tomcat.util.buf.ByteChunk;
import org.apache.tomcat.util.buf.MessageBytes;
import org.apache.tomcat.util.http.MimeHeaders;
+import org.apache.tomcat.util.net.AprEndpoint;
import org.apache.tomcat.util.res.StringManager;
import org.apache.coyote.InputBuffer;
@@ -42,18 +43,16 @@
public class InternalAprInputBuffer implements InputBuffer {
- // -------------------------------------------------------------- Constants
-
-
// ----------------------------------------------------------- Constructors
/**
* Alternate constructor.
*/
- public InternalAprInputBuffer(Request request, int headerBufferSize) {
+ public InternalAprInputBuffer(Request request, int headerBufferSize, AprEndpoint endpoint) {
this.request = request;
+ this.endpoint = endpoint;
headers = request.getMimeHeaders();
buf = new byte[headerBufferSize];
@@ -186,6 +185,12 @@
protected boolean available = false;
+ /**
+ * Apr endpoint.
+ */
+ protected AprEndpoint endpoint = null;
+
+
// ------------------------------------------------------------- Properties
@@ -799,11 +804,7 @@
} else {
// In this specific situation, perform the read again in blocking mode (the user is not
// using available and simply wants to read all data)
- Socket.optSet(socket, Socket.APR_SO_NONBLOCK, 0);
- Socket.timeoutSet(socket, 20000*1000);
- nRead = Socket.recvbb(socket, 0, buf.length - lastValid);
- Socket.optSet(socket, Socket.APR_SO_NONBLOCK, 1);
- Socket.timeoutSet(socket, 0);
+ nRead = Socket.recvbbt(socket, 0, buf.length - lastValid, endpoint.getSoTimeout() * 1000);
if (nRead > 0) {
bbuf.limit(nRead);
bbuf.get(buf, pos, nRead);
Modified: trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
===================================================================
--- trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2008-03-04 15:39:25 UTC (rev 465)
+++ trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2008-03-04 17:35:40 UTC (rev 466)
@@ -26,6 +26,7 @@
import org.apache.tomcat.util.buf.MessageBytes;
import org.apache.tomcat.util.http.HttpMessages;
import org.apache.tomcat.util.http.MimeHeaders;
+import org.apache.tomcat.util.net.AprEndpoint;
import org.apache.tomcat.util.res.StringManager;
import org.apache.coyote.ActionCode;
@@ -48,19 +49,12 @@
/**
- * Default constructor.
- */
- public InternalAprOutputBuffer(Response response) {
- this(response, Constants.DEFAULT_HTTP_HEADER_BUFFER_SIZE);
- }
-
-
- /**
* Alternate constructor.
*/
- public InternalAprOutputBuffer(Response response, int headerBufferSize) {
+ public InternalAprOutputBuffer(Response response, int headerBufferSize, AprEndpoint endpoint) {
this.response = response;
+ this.endpoint = endpoint;
headers = response.getMimeHeaders();
buf = new byte[headerBufferSize];
@@ -186,6 +180,12 @@
protected boolean nonBlocking = false;
+ /**
+ * Apr endpoint.
+ */
+ protected AprEndpoint endpoint = null;
+
+
// ------------------------------------------------------------- Properties
@@ -805,9 +805,7 @@
System.out.println("Leftovers present");
if (Http11AprProcessor.containerThread.get() == Boolean.TRUE) {
System.out.println("Send leftovers using blocking");
- Socket.optSet(socket, Socket.APR_SO_NONBLOCK, 0);
- // Also use the usual timeout
- Socket.timeoutSet(socket, 20000*1000);
+ Socket.timeoutSet(socket, endpoint.getSoTimeout() * 1000);
// Send leftover bytes
res = Socket.send(socket, leftover.getBuffer(), leftover.getOffset(), leftover.getEnd());
leftover.recycle();
@@ -815,7 +813,6 @@
if (res > 0) {
res = Socket.sendbb(socket, 0, bbuf.position());
}
- Socket.optSet(socket, Socket.APR_SO_NONBLOCK, 1);
Socket.timeoutSet(socket, 0);
} else {
throw new IOException("Backlog");
@@ -843,10 +840,8 @@
if (response.getFlushLeftovers() && (Http11AprProcessor.containerThread.get() == Boolean.TRUE)) {
System.out.println("Blocking write of all data");
// Switch to blocking mode and write the data
- Socket.optSet(socket, Socket.APR_SO_NONBLOCK, 0);
- Socket.timeoutSet(socket, 20000*1000);
+ Socket.timeoutSet(socket, endpoint.getSoTimeout() * 1000);
res = Socket.sendbb(socket, 0, bbuf.position());
- Socket.optSet(socket, Socket.APR_SO_NONBLOCK, 1);
Socket.timeoutSet(socket, 0);
} else {
// Put any leftover bytes in the leftover byte chunk
16 years, 2 months
JBossWeb SVN: r465 - trunk/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-03-04 10:39:25 -0500 (Tue, 04 Mar 2008)
New Revision: 465
Modified:
trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java
Log:
- Just in case, handle the case where the result is 0 (for some reason, it can happen).
Modified: trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java
===================================================================
--- trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java 2008-03-04 15:38:27 UTC (rev 464)
+++ trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java 2008-03-04 15:39:25 UTC (rev 465)
@@ -788,20 +788,18 @@
bbuf.limit(nRead);
bbuf.get(buf, pos, nRead);
lastValid = pos + nRead;
- } else if (nRead < 0) {
+ } else if (nRead <= 0) {
if ((-nRead) == Status.ETIMEDOUT || (-nRead) == Status.TIMEUP) {
throw new SocketTimeoutException(sm.getString("iib.failedread"));
} else if ((-nRead) == Status.EAGAIN && nonBlocking) {
- // FIXME: I don't understand why the result is not nRead = 0
- /* As asynchronous reads are forbidden, this test is not useful */
- /*&& (Http11AprProcessor.containerThread.get() == Boolean.TRUE)*/
+ // As asynchronous reads are forbidden, this test is not useful
+ // && (Http11AprProcessor.containerThread.get() == Boolean.TRUE)
if (available) {
nRead = 0;
} else {
// In this specific situation, perform the read again in blocking mode (the user is not
// using available and simply wants to read all data)
Socket.optSet(socket, Socket.APR_SO_NONBLOCK, 0);
- // Also use the usual timeout
Socket.timeoutSet(socket, 20000*1000);
nRead = Socket.recvbb(socket, 0, buf.length - lastValid);
Socket.optSet(socket, Socket.APR_SO_NONBLOCK, 1);
@@ -810,7 +808,7 @@
bbuf.limit(nRead);
bbuf.get(buf, pos, nRead);
lastValid = pos + nRead;
- } else if (nRead < 0) {
+ } else if (nRead <= 0) {
if ((-nRead) == Status.ETIMEDOUT || (-nRead) == Status.TIMEUP) {
throw new SocketTimeoutException(sm.getString("iib.failedread"));
} else {
16 years, 2 months
JBossWeb SVN: r464 - in trunk/java/org/apache/tomcat/util/net: res and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-03-04 10:38:27 -0500 (Tue, 04 Mar 2008)
New Revision: 464
Modified:
trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties
Log:
- Add a specific message for maintain (= timeout processing) errors.
Modified: trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2008-03-04 02:31:01 UTC (rev 463)
+++ trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2008-03-04 15:38:27 UTC (rev 464)
@@ -1501,7 +1501,7 @@
while (keepAliveCount < 1 && addList.size() < 1) {
// Reset maintain time.
- maintainTime = 0;
+ maintainTime = 1;
try {
synchronized (this) {
this.wait(10000);
@@ -1512,7 +1512,7 @@
} catch (InterruptedException e) {
// Ignore
} catch (Throwable t) {
- log.error(sm.getString("endpoint.poll.error"), t);
+ log.error(sm.getString("endpoint.maintain.error"), t);
}
}
@@ -1633,10 +1633,15 @@
// non Comet poller might be a bit faster by using the old maintain.
maintainTime = 0;
maintain();
+ maintainTime = 1;
}
} catch (Throwable t) {
- log.error(sm.getString("endpoint.poll.error"), t);
+ if (maintainTime == 0) {
+ log.error(sm.getString("endpoint.maintain.error"), t);
+ } else {
+ log.error(sm.getString("endpoint.poll.error"), t);
+ }
}
}
Modified: trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties
===================================================================
--- trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties 2008-03-04 02:31:01 UTC (rev 463)
+++ trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties 2008-03-04 15:38:27 UTC (rev 464)
@@ -20,6 +20,7 @@
endpoint.poll.fail=Critical poller failure (restarting poller): [{0}] {1}
endpoint.poll.fail=Socket [{0}] poll event: [{1}] {2}
endpoint.poll.error=Unexpected poller error
+endpoint.maintain.error=Error processing timeouts
endpoint.process.fail=Error allocating socket processor
endpoint.sendfile.error=Unexpected sendfile error
endpoint.sendfile.addfail=Sednfile failure: [{0}] {1}
16 years, 2 months