hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1726985 - /httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
Date Wed, 27 Jan 2016 09:47:30 GMT
Author: olegk
Date: Wed Jan 27 09:47:30 2016
New Revision: 1726985

URL: http://svn.apache.org/viewvc?rev=1726985&view=rev
Log:
HTTPCORE-417: SSLIOSession#writePlain incorrectly handles closed channel condition leading
to an infinite loop

Modified:
    httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java?rev=1726985&r1=1726984&r2=1726985&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
(original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
Wed Jan 27 09:47:30 2016
@@ -32,6 +32,7 @@ import java.net.Socket;
 import java.net.SocketAddress;
 import java.nio.ByteBuffer;
 import java.nio.channels.ByteChannel;
+import java.nio.channels.ClosedChannelException;
 import java.nio.channels.SelectionKey;
 
 import javax.net.ssl.SSLContext;
@@ -563,10 +564,10 @@ public class SSLIOSession implements IOS
         return this.sslEngine.isOutboundDone();
     }
 
-    private synchronized int writePlain(final ByteBuffer src) throws SSLException {
+    private synchronized int writePlain(final ByteBuffer src) throws IOException {
         Args.notNull(src, "Byte buffer");
         if (this.status != ACTIVE) {
-            return -1;
+            throw new ClosedChannelException();
         }
         if (this.outPlain.hasData()) {
             // Acquire buffers



Mime
View raw message