git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1332230 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2012-04-30 14:56:09 +00:00
parent ec87b17be0
commit e96eab52a1
1 changed files with 9 additions and 3 deletions

View File

@ -135,7 +135,11 @@ public class NIOSSLTransport extends NIOTransport {
while(true) { while(true) {
if (!plain.hasRemaining()) { if (!plain.hasRemaining()) {
if (status == SSLEngineResult.Status.OK && handshakeStatus != SSLEngineResult.HandshakeStatus.NEED_UNWRAP) {
plain.clear(); plain.clear();
} else {
plain.compact();
}
int readCount = secureRead(plain); int readCount = secureRead(plain);
@ -150,7 +154,9 @@ public class NIOSSLTransport extends NIOTransport {
} }
} }
if (status == SSLEngineResult.Status.OK && handshakeStatus != SSLEngineResult.HandshakeStatus.NEED_UNWRAP) {
processCommand(plain); processCommand(plain);
}
} }
} catch (IOException e) { } catch (IOException e) {
@ -192,7 +198,7 @@ public class NIOSSLTransport extends NIOTransport {
protected int secureRead(ByteBuffer plain) throws Exception { protected int secureRead(ByteBuffer plain) throws Exception {
if (!(inputBuffer.position() != 0 && inputBuffer.hasRemaining())) { if (!(inputBuffer.position() != 0 && inputBuffer.hasRemaining()) || status == SSLEngineResult.Status.BUFFER_UNDERFLOW) {
int bytesRead = channel.read(inputBuffer); int bytesRead = channel.read(inputBuffer);
if (bytesRead == -1) { if (bytesRead == -1) {