Author: remm
Date: Thu Jan 15 14:28:13 2015
New Revision: 1652108

URL: http://svn.apache.org/r1652108
Log:
Fix use of the semaphore (it seems equivalent to not using it). This fixes the 
ab corruption I was experiencing.

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

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java?rev=1652108&r1=1652107&r2=1652108&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java Thu Jan 15 
14:28:13 2015
@@ -744,11 +744,13 @@ public class Nio2Endpoint extends Abstra
                     failed(new ClosedChannelException(), attachment);
                     return;
                 }
+                readPending.release();
                 getEndpoint().processSocket(attachment, 
SocketStatus.OPEN_READ, true);
             }
 
             @Override
             public void failed(Throwable exc, SocketWrapperBase<Nio2Channel> 
attachment) {
+                readPending.release();
                 getEndpoint().processSocket(attachment, 
SocketStatus.DISCONNECT, true);
             }
         };
@@ -1310,9 +1312,6 @@ public class Nio2Endpoint extends Abstra
                 getSocket().getBufHandler().configureReadBufferForWrite();
                 getSocket().read(getSocket().getBufHandler().getReadBuffer(),
                         getTimeout(), TimeUnit.MILLISECONDS, this, 
awaitBytesHandler);
-                // TODO Figure out why moving this to the awaitBytesHandler
-                //      causes test failures.
-                readPending.release();
             }
         }
     }



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

Reply via email to