DO NOT REPLY [Bug 51141] Struts 1 bean exception in JSP after upgrading from Tomcat 6.0.28

2011-05-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51141

asfbugzill...@eghm.net changed:

   What|Removed |Added

 Resolution|INVALID |WONTFIX

--- Comment #4 from asfbugzill...@eghm.net 2011-05-16 06:02:08 UTC ---
This issue was caused by a missing web.xml in a subproject.  I double checked
that Tomcat 6.0.28 doesn't require the web.xml.  I'm guessing that behavior
would be considered a bug and won't be carried forward into Tomcat 7.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1103633 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java

2011-05-16 Thread markt
Author: markt
Date: Mon May 16 07:31:23 2011
New Revision: 1103633

URL: http://svn.apache.org/viewvc?rev=1103633view=rev
Log:
Prevent infinite loop when readTimeout = 0

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java?rev=1103633r1=1103632r2=1103633view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java Mon 
May 16 07:31:23 2011
@@ -178,7 +178,7 @@ public class NioBlockingSelector {
 keycount = 1;
 att.resetReadLatch();
 }
-if (readTimeout  0  (keycount == 0))
+if (readTimeout = 0  (keycount == 0))
 timedout = (System.currentTimeMillis() - time) = 
readTimeout;
 } //while
 if (timedout)



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1103634 - /tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java

2011-05-16 Thread markt
Author: markt
Date: Mon May 16 07:33:35 2011
New Revision: 1103634

URL: http://svn.apache.org/viewvc?rev=1103634view=rev
Log:
Remove unused code

Modified:
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java?rev=1103634r1=1103633r2=1103634view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Mon May 16 
07:33:35 2011
@@ -116,13 +116,6 @@ public class AjpNioProcessor extends Abs
 
 
 /**
- * NIO socket read may return more than just the current message. Need to
- * buffer the response to ensure data isn't lost.
- */
-protected byte[] inputBuffer;
-protected int inputBufferEnd;
-
-/**
  * Direct buffer used for sending right away a get body message.
  */
 protected final byte[] getBodyMessageArray;



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 50839] Closing connection on the client side (browser) during unfinished transmission result in 100% CPU slike for 30 sec during socket shutdownd in jk_connect.c

2011-05-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=50839

--- Comment #6 from Tim Whittington t...@apache.org 2011-05-16 08:25:44 UTC 
---
The trace log from Konstantin shows that the ISAPI Redirector is spending all
it's time in jk_shutdown_socket, calling jk_is_input_event - basically draining
all the AJP response packets (which will all be SEND_BODY_CHUNK packets).

The Java side of the AJP connector also blindly continues writing out an entire
chunk (across multiple SEND_BODY_CHUNK packets), and possibly across multiple
writes (I can't quite get my head around how an AJP response stream would be
terminated on a client abort on the HTTP side).

I think this behaviour was introduced when the socket shutdown was tidied up to
politely drain lingering bytes on the AJP connection before closing the socket
- in extreme cases this seems to allow the Java side to continue writing data.

I'm thinking at this point the simplest fix is to cap the amount of lingering
bytes the AJP reset will handle on the Tomcat Connector end, and simply close
the AJP connection if that is exceeded.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 50839] Closing connection on the client side (browser) during unfinished transmission result in 100% CPU slike for 30 sec during socket shutdownd in jk_connect.c

2011-05-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=50839

--- Comment #7 from Rainer Jung rainer.j...@kippdata.de 2011-05-16 08:48:21 
UTC ---
+1 to such a solution. Limit by number of bytes plus the time we do the
lingering. Break after say 32KB read or 2 seconds linger. Waiting longer or
reading more is just wasting precious resources.

Rainer

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 51088] ArrayIndexOutOfBoundsException from org.apache.el.parser.JJTELParserState

2011-05-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51088

--- Comment #4 from Michael Heinen mhn4...@googlemail.com 2011-05-16 09:32:16 
UTC ---
a) can be excluded (no rarely executed if-branch)
c) could be possible indeed (although an OOM did not occur, but maybe another
RuntimeException)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r1103633 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java

2011-05-16 Thread Filip Hanik - Dev Lists

-1 for this change. 0 means infinite (no timeout)

http://download.oracle.com/javase/6/docs/api/java/net/Socket.html#setSoTimeout%28int%29

Filip

On 5/16/2011 1:31 AM, ma...@apache.org wrote:

Author: markt
Date: Mon May 16 07:31:23 2011
New Revision: 1103633

URL: http://svn.apache.org/viewvc?rev=1103633view=rev
Log:
Prevent infinite loop when readTimeout = 0

Modified:
 tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java?rev=1103633r1=1103632r2=1103633view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java Mon 
May 16 07:31:23 2011
@@ -178,7 +178,7 @@ public class NioBlockingSelector {
  keycount = 1;
  att.resetReadLatch();
  }
-if (readTimeout  0  (keycount == 0))
+if (readTimeout= 0  (keycount == 0))
  timedout = (System.currentTimeMillis() - time)= 
readTimeout;
  } //while
  if (timedout)



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1321 / Virus Database: 1500/3640 - Release Date: 05/15/11





-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1103788 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java

2011-05-16 Thread markt
Author: markt
Date: Mon May 16 16:39:42 2011
New Revision: 1103788

URL: http://svn.apache.org/viewvc?rev=1103788view=rev
Log:
SHARED_SELECTOR is used with double checked locking so it needs to be volatile

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java?rev=1103788r1=1103787r2=1103788view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java Mon May 
16 16:39:42 2011
@@ -50,7 +50,7 @@ public class NioSelectorPool {
 
 protected NioBlockingSelector blockingSelector;
 
-protected Selector SHARED_SELECTOR;
+protected volatile Selector SHARED_SELECTOR;
 
 protected int maxSelectors = 200;
 protected long sharedSelectorTimeout = 3;



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 51206] New: CATALINA_BASE is not visible to setenv.sh

2011-05-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51206

 Bug #: 51206
   Summary: CATALINA_BASE is not visible to setenv.sh
   Product: Tomcat 6
   Version: 6.0.32
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: fha...@apache.org
Classification: Unclassified


If this variable is not visible, it makes the setenv.sh script sort of useless

Index: bin/catalina.sh
===
--- bin/catalina.sh(revision 1103812)
+++ bin/catalina.sh(working copy)
@@ -116,6 +116,9 @@
 # Ensure that any user defined CLASSPATH variables are not used on startup,
 # but allow them to be specified in setenv.sh, in rare case when it is needed.
 CLASSPATH=
+if [ -z $CATALINA_BASE ] ; then
+  CATALINA_BASE=$CATALINA_HOME
+fi

 if [ -r $CATALINA_BASE/bin/setenv.sh ]; then
   . $CATALINA_BASE/bin/setenv.sh
@@ -163,10 +166,8 @@
   fi
 fi

-if [ -z $CATALINA_BASE ] ; then
-  CATALINA_BASE=$CATALINA_HOME
-fi

+
 # Add tomcat-juli.jar and bootstrap.jar to classpath
 # tomcat-juli.jar can be over-ridden per instance
 if [ ! -z $CLASSPATH ] ; then

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 51206] CATALINA_BASE is not visible to setenv.sh

2011-05-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51206

--- Comment #1 from Filip Hanik fha...@apache.org 2011-05-16 18:13:27 UTC ---
The fix will have to be modified a little bit to avoid calling
CATALINA_HOME/bin/setenv.sh twice

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1103860 - in /tomcat/trunk/java/org/apache/coyote/ajp: AjpNioProcessor.java AjpNioProtocol.java

2011-05-16 Thread markt
Author: markt
Date: Mon May 16 19:56:21 2011
New Revision: 1103860

URL: http://svn.apache.org/viewvc?rev=1103860view=rev
Log:
Tweak processor blocking so that it is non-blocking while no message is being 
processed and blocking during the processing of a message
Align ajp nio protocol implementation with http nio
Still some TCK failures to resolve

Modified:
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java?rev=1103860r1=1103859r2=1103860view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Mon May 16 
19:56:21 2011
@@ -196,29 +196,20 @@ public class AjpNioProcessor extends Abs
 // Setting up the socket
 this.socket = socket;
 
-int soTimeout = -1;
-final KeyAttachment ka = (KeyAttachment)socket.getAttachment(false);
-if (keepAliveTimeout  0) {
-ka.setTimeout(soTimeout);
-}
+long soTimeout = endpoint.getSoTimeout();
+int keepAliveTimeout = endpoint.getKeepAliveTimeout();
 
 // Error flag
 error = false;
 
-boolean keptAlive = false;
-
+final KeyAttachment ka = (KeyAttachment)socket.getAttachment(false);
+
 while (!error  !endpoint.isPaused()) {
-
 // Parsing the request header
 try {
-// Set keep alive timeout if enabled
-if (keepAliveTimeout  0) {
-ka.setTimeout(keepAliveTimeout);
-}
 // Get first message of the request
-int bytesRead = readMessage(requestHeaderMessage, !keptAlive);
-if (!keptAlive  bytesRead == 0) {
-// No bytes on a blocking read - connection timeout
+int bytesRead = readMessage(requestHeaderMessage, false);
+if (bytesRead == 0) {
 rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
 break;
 }
@@ -235,8 +226,6 @@ public class AjpNioProcessor extends Abs
 } catch (IOException e) {
 error = true;
 }
-// Should be unnecessary but just in case...
-keptAlive = true;
 recycle();
 continue;
 } else if(type != Constants.JK_AJP13_FORWARD_REQUEST) {
@@ -244,12 +233,9 @@ public class AjpNioProcessor extends Abs
 if(log.isDebugEnabled()) {
 log.debug(Unexpected message: +type);
 }
-// Should be unnecessary but just in case...
-keptAlive = true;
 recycle();
 continue;
 }
-
 request.setStartTime(System.currentTimeMillis());
 } catch (IOException e) {
 error = true;
@@ -324,7 +310,11 @@ public class AjpNioProcessor extends Abs
 request.updateCounters();
 
 rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
-keptAlive = true;
+// Set keep alive timeout if enabled
+if (keepAliveTimeout  0) {
+ka.setTimeout(keepAliveTimeout);
+}
+
 recycle();
 }
 
@@ -479,18 +469,23 @@ public class AjpNioProcessor extends Abs
 /**
  * Read the specified amount of bytes, and place them in the input buffer.
  */
-protected int read(byte[] buf, int pos, int n, boolean block)
+protected int read(byte[] buf, int pos, int n, boolean blockFirstRead)
 throws IOException {
 
 int read = 0;
 int res = 0;
+boolean block = blockFirstRead;
+
 while (read  n) {
 res = readSocket(buf, read + pos, n, block);
 if (res  0) {
 read += res;
+} else if (res == 0  !block) {
+break;
 } else {
 throw new IOException(sm.getString(ajpprotocol.failedread));
 }
+block = true;
 }
 return read;
 }
@@ -596,14 +591,18 @@ public class AjpNioProcessor extends Abs
  * @return The number of bytes read
  * @throws IOException any other failure, including incomplete reads
  */
-protected int readMessage(AjpMessage message, boolean block)
+protected int readMessage(AjpMessage message, boolean blockFirstRead)
 throws IOException {
 
 byte[] buf = message.getBuffer();
 int headerLength = message.getHeaderLength();
 
-int bytesRead = 

svn commit: r1103908 - /tomcat/trunk/java/org/apache/catalina/security/SecurityClassLoad.java

2011-05-16 Thread markt
Author: markt
Date: Mon May 16 21:30:52 2011
New Revision: 1103908

URL: http://svn.apache.org/viewvc?rev=1103908view=rev
Log:
Fix Security Exceptions when running Servlet TCK with experimental nio-apr 
connector

Modified:
tomcat/trunk/java/org/apache/catalina/security/SecurityClassLoad.java

Modified: tomcat/trunk/java/org/apache/catalina/security/SecurityClassLoad.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/security/SecurityClassLoad.java?rev=1103908r1=1103907r2=1103908view=diff
==
--- tomcat/trunk/java/org/apache/catalina/security/SecurityClassLoad.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/security/SecurityClassLoad.java Mon 
May 16 21:30:52 2011
@@ -248,6 +248,12 @@ public final class SecurityClassLoad {
 clazz.newInstance();
 loader.loadClass(basePackage + util.http.HttpMessages);
 loader.loadClass(basePackage + util.net.Constants);
+loader.loadClass(basePackage +
+util.net.NioBlockingSelector$BlockPoller$1);
+loader.loadClass(basePackage +
+util.net.NioBlockingSelector$BlockPoller$2);
+loader.loadClass(basePackage +
+util.net.NioBlockingSelector$BlockPoller$3);
 loader.loadClass(basePackage + util.net.SSLSupport$CipherData);
 loader.loadClass
 (basePackage + util.net.JIoEndpoint$PrivilegedSetTccl);



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r1103633 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java

2011-05-16 Thread Mark Thomas
On 16/05/2011 16:24, Filip Hanik - Dev Lists wrote:
 -1 for this change. 0 means infinite (no timeout)
 
 http://download.oracle.com/javase/6/docs/api/java/net/Socket.html#setSoTimeout%28int%29

The problem is that readTimeout is also used in line 169:
att.awaitReadLatch(readTimeout,TimeUnit.MILLISECONDS);

and in that case the timeout is not infinite, it is immediate (Rainer
checked the JRE source) which triggers a tight CPU burning loop.

Any suggestions for a better solution? How about changing a value of 0
to -1 at the start of the method?

Mark

 
 Filip
 
 On 5/16/2011 1:31 AM, ma...@apache.org wrote:
 Author: markt
 Date: Mon May 16 07:31:23 2011
 New Revision: 1103633

 URL: http://svn.apache.org/viewvc?rev=1103633view=rev
 Log:
 Prevent infinite loop when readTimeout = 0

 Modified:
 
 tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java

 Modified:
 tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
 URL:
 http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java?rev=1103633r1=1103632r2=1103633view=diff

 ==

 ---
 tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
 (original)
 +++
 tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
 Mon May 16 07:31:23 2011
 @@ -178,7 +178,7 @@ public class NioBlockingSelector {
   keycount = 1;
   att.resetReadLatch();
   }
 -if (readTimeout  0  (keycount == 0))
 +if (readTimeout= 0  (keycount == 0))
   timedout = (System.currentTimeMillis() - time)=
 readTimeout;
   } //while
   if (timedout)



 -
 To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: dev-h...@tomcat.apache.org



 -
 No virus found in this message.
 Checked by AVG - www.avg.com
 Version: 10.0.1321 / Virus Database: 1500/3640 - Release Date: 05/15/11


 
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: dev-h...@tomcat.apache.org
 




-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r1103633 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java

2011-05-16 Thread Filip Hanik - Dev Lists

I take back my -1
looking at the javadoc, it defines -1 as infinite.

So your commit is correct, but requires an addition

-att.awaitReadLatch(readTimeout,TimeUnit.MILLISECONDS);

+if (readTimeout0) {
+  att.awaitReadLatch(Long.MAX_VALUE,TimeUnit.MILLISECONDS);
+} else {
+  att.awaitReadLatch(readTimeout,TimeUnit.MILLISECONDS);
+}


Filip



On 5/16/2011 3:38 PM, Mark Thomas wrote:

On 16/05/2011 16:24, Filip Hanik - Dev Lists wrote:

-1 for this change. 0 means infinite (no timeout)

http://download.oracle.com/javase/6/docs/api/java/net/Socket.html#setSoTimeout%28int%29

The problem is that readTimeout is also used in line 169:
att.awaitReadLatch(readTimeout,TimeUnit.MILLISECONDS);

and in that case the timeout is not infinite, it is immediate (Rainer
checked the JRE source) which triggers a tight CPU burning loop.

Any suggestions for a better solution? How about changing a value of 0
to -1 at the start of the method?

Mark


Filip

On 5/16/2011 1:31 AM, ma...@apache.org wrote:

Author: markt
Date: Mon May 16 07:31:23 2011
New Revision: 1103633

URL: http://svn.apache.org/viewvc?rev=1103633view=rev
Log:
Prevent infinite loop when readTimeout = 0

Modified:

tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java?rev=1103633r1=1103632r2=1103633view=diff

==

---
tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
Mon May 16 07:31:23 2011
@@ -178,7 +178,7 @@ public class NioBlockingSelector {
   keycount = 1;
   att.resetReadLatch();
   }
-if (readTimeout   0   (keycount == 0))
+if (readTimeout= 0   (keycount == 0))
   timedout = (System.currentTimeMillis() - time)=
readTimeout;
   } //while
   if (timedout)



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1321 / Virus Database: 1500/3640 - Release Date: 05/15/11




-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org





-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1321 / Virus Database: 1500/3641 - Release Date: 05/16/11





-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r1103633 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java

2011-05-16 Thread Mark Thomas
On 16/05/2011 22:47, Filip Hanik - Dev Lists wrote:
 I take back my -1
 looking at the javadoc, it defines -1 as infinite.
 
 So your commit is correct, but requires an addition
 
 -att.awaitReadLatch(readTimeout,TimeUnit.MILLISECONDS);
 
 +if (readTimeout0) {
 +  att.awaitReadLatch(Long.MAX_VALUE,TimeUnit.MILLISECONDS);
 +} else {
 +  att.awaitReadLatch(readTimeout,TimeUnit.MILLISECONDS);
 +}

Thanks - I'll get that committed shortly.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1103923 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java

2011-05-16 Thread markt
Author: markt
Date: Mon May 16 22:02:04 2011
New Revision: 1103923

URL: http://svn.apache.org/viewvc?rev=1103923view=rev
Log:
Add Filip's additional patch to correctly handle infinite read timeouts

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java?rev=1103923r1=1103922r2=1103923view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java Mon 
May 16 22:02:04 2011
@@ -166,7 +166,11 @@ public class NioBlockingSelector {
 try {
 if ( att.getReadLatch()==null || 
att.getReadLatch().getCount()==0) att.startReadLatch(1);
 poller.add(att,SelectionKey.OP_READ, reference);
-att.awaitReadLatch(readTimeout,TimeUnit.MILLISECONDS);
+if (readTimeout  0) {
+att.awaitReadLatch(Long.MAX_VALUE, 
TimeUnit.MILLISECONDS);
+} else {
+att.awaitReadLatch(readTimeout, TimeUnit.MILLISECONDS);
+}
 }catch (InterruptedException ignore) {
 Thread.interrupted();
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r1103633 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java

2011-05-16 Thread Mark Thomas
On 16/05/2011 22:54, Mark Thomas wrote:
 On 16/05/2011 22:47, Filip Hanik - Dev Lists wrote:
 I take back my -1
 looking at the javadoc, it defines -1 as infinite.

 So your commit is correct, but requires an addition

 -att.awaitReadLatch(readTimeout,TimeUnit.MILLISECONDS);

 +if (readTimeout0) {
 +  att.awaitReadLatch(Long.MAX_VALUE,TimeUnit.MILLISECONDS);
 +} else {
 +  att.awaitReadLatch(readTimeout,TimeUnit.MILLISECONDS);
 +}
 
 Thanks - I'll get that committed shortly.

Woot. That seems to have fixed a bunch of additional issues I was
seeing. Thanks again.

I'll test this more thoroughly tomorrow.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org