larryi 02/02/04 17:34:02
Modified: src/share/org/apache/tomcat/modules/server
Http10Interceptor.java
Log:
Revert back to the delaySocketClose attribute. The new code turned out
not to help.
Revision Changes Path
1.32 +11 -17
jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10Interceptor.java
Index: Http10Interceptor.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10Interceptor.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- Http10Interceptor.java 31 Jan 2002 04:16:47 -0000 1.31
+++ Http10Interceptor.java 5 Feb 2002 01:34:02 -0000 1.32
@@ -100,7 +100,7 @@
{
private int timeout = 300000; // 5 minutes as in Apache HTTPD server
private String reportedname;
- private int socketCloseDelay = -1;
+ private boolean delaySocketClose = false;
public Http10Interceptor() {
super();
@@ -123,8 +123,8 @@
reportedname = reportedName;
}
- public void setSocketCloseDelay(int d) {
- socketCloseDelay=d;
+ public void setDelaySocketClose(boolean b) {
+ delaySocketClose=b;
}
public void setProperty( String prop, String value ) {
@@ -208,20 +208,14 @@
log( "Error reading request, ignored", e, Log.ERROR);
}
finally {
- // When running tests against Tomcat on the same system,
- // we may need to add a delay before closing the socket
- // to give the other end of the connection a chance to run
- if( socketCloseDelay >= 0 ) {
- if( socketCloseDelay > 0 ) {
- // if delay is specified, spin for that amount of time
- // Note: using Thread.sleep(n) exacerbates the problem on
- // RH Linux 7.1 and maybe others
- long target = System.currentTimeMillis() + socketCloseDelay;
- while( target <= System.currentTimeMillis())
- ;
- } else {
- Thread.yield();
- }
+ // When running tests against Tomcat on the same
+ // system, we may need to force a thread switch
+ // before closing the socket to give the other
+ // end of the connection a chance to run
+ if( delaySocketClose ) {
+ try {
+ Thread.sleep(0);
+ } catch (InterruptedException ie) { /* ignore */ }
}
// recycle kernel sockets ASAP
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>