Author: markt
Date: Tue Feb 24 12:15:56 2015
New Revision: 1661914
URL: http://svn.apache.org/r1661914
Log:
Fix a bug that meant if end of stream was reached, any data read in this call
prior to reaching end of stream was lost.
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=1661914&r1=1661913&r2=1661914&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java Tue Feb
24 12:15:56 2015
@@ -245,7 +245,13 @@ public class NioSelectorPool {
int cnt = 0;
if ( keycount > 0 ) { //only read if we were registered for a
read
cnt = socket.read(buf);
- if (cnt == -1) throw new EOFException();
+ if (cnt == -1) {
+ if (read == 0) {
+ throw new EOFException();
+ } else {
+ break;
+ }
+ }
read += cnt;
if (cnt > 0) continue; //read some more
if (cnt==0 && (read>0 || (!block) ) ) break; //we are done
reading
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]