You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2016/01/27 10:46:25 UTC
svn commit: r1726984 -
/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
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