mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-3819 - handle BUFFER_UNDERFLOW case
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1332230 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ec87b17be0
commit
e96eab52a1
|
@ -135,7 +135,11 @@ public class NIOSSLTransport extends NIOTransport {
|
||||||
while(true) {
|
while(true) {
|
||||||
if (!plain.hasRemaining()) {
|
if (!plain.hasRemaining()) {
|
||||||
|
|
||||||
plain.clear();
|
if (status == SSLEngineResult.Status.OK && handshakeStatus != SSLEngineResult.HandshakeStatus.NEED_UNWRAP) {
|
||||||
|
plain.clear();
|
||||||
|
} else {
|
||||||
|
plain.compact();
|
||||||
|
}
|
||||||
int readCount = secureRead(plain);
|
int readCount = secureRead(plain);
|
||||||
|
|
||||||
|
|
||||||
|
@ -150,7 +154,9 @@ public class NIOSSLTransport extends NIOTransport {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
processCommand(plain);
|
if (status == SSLEngineResult.Status.OK && handshakeStatus != SSLEngineResult.HandshakeStatus.NEED_UNWRAP) {
|
||||||
|
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) {
|
||||||
|
|
Loading…
Reference in New Issue