hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1726984 - /httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
Date Wed, 27 Jan 2016 09:46:25 GMT
Author: olegk
Date: Wed Jan 27 09:46:25 2016
New Revision: 1726984

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

Modified:
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java?rev=1726984&r1=1726983&r2=1726984&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
Wed Jan 27 09:46:25 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;
@@ -549,10 +550,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