You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2015/06/11 18:49:56 UTC

svn commit: r1684943 - /tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java

Author: remm
Date: Thu Jun 11 16:49:56 2015
New Revision: 1684943

URL: http://svn.apache.org/r1684943
Log:
Fix loop that occurred with NIO (and could cause issues with APR as well) with a closed connection during keepalive.

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java?rev=1684943&r1=1684942&r2=1684943&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java Thu Jun 11 16:49:56 2015
@@ -16,6 +16,7 @@
  */
 package org.apache.coyote.http11;
 
+import java.io.EOFException;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
@@ -729,9 +730,12 @@ public class Http11InputBuffer implement
         if (nRead > 0) {
             lastValid = pos + nRead;
             return true;
+        } else if (nRead < 0) {
+            throw new EOFException(sm.getString("iib.eof.error"));
+        } else {
+            return false;
         }
 
-        return false;
     }
 
 



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