This commit is contained in:
Redkale
2019-03-15 10:19:00 +08:00
parent d7a3f4d87d
commit 0aa4d6c967

View File

@@ -461,7 +461,7 @@ public final class WebSocketPacket {
} }
} }
if (length > wsmaxbody && wsmaxbody > 0) { if (length > wsmaxbody && wsmaxbody > 0) {
logger.log(Level.INFO, "message length (" + length + ") too big, must less " + wsmaxbody + ""); logger.log(Level.WARNING, "message length (" + length + ") too big, must less " + wsmaxbody + "");
return null; return null;
} }
this.receiveLength = length; this.receiveLength = length;
@@ -495,7 +495,8 @@ public final class WebSocketPacket {
buffers = webSocket._engine.cryptor.decrypt(buffers, context.getBufferSupplier(), context.getBufferConsumer()); buffers = webSocket._engine.cryptor.decrypt(buffers, context.getBufferSupplier(), context.getBufferConsumer());
} }
FrameType selfType = this.type; FrameType selfType = this.type;
if (selfType == FrameType.SERIES) { final boolean series = selfType == FrameType.SERIES;
if (series) {
selfType = runner.currSeriesMergeFrameType; selfType = runner.currSeriesMergeFrameType;
this.type = selfType; this.type = selfType;
} else if (!this.last && (selfType == FrameType.TEXT || selfType == FrameType.BINARY)) { } else if (!this.last && (selfType == FrameType.TEXT || selfType == FrameType.BINARY)) {
@@ -504,7 +505,7 @@ public final class WebSocketPacket {
if (selfType == FrameType.TEXT) { if (selfType == FrameType.TEXT) {
Convert textConvert = webSocket.getTextConvert(); Convert textConvert = webSocket.getTextConvert();
if (textConvert == null) { if (textConvert == null || (!runner.mergemsg && (series || !this.last))) {
this.receiveMessage = new String(this.getReceiveBytes(buffers), StandardCharsets.UTF_8); this.receiveMessage = new String(this.getReceiveBytes(buffers), StandardCharsets.UTF_8);
this.receiveType = MessageType.STRING; this.receiveType = MessageType.STRING;
} else { } else {
@@ -529,7 +530,7 @@ public final class WebSocketPacket {
} }
} else if (selfType == FrameType.BINARY) { } else if (selfType == FrameType.BINARY) {
Convert binaryConvert = webSocket.getBinaryConvert(); Convert binaryConvert = webSocket.getBinaryConvert();
if (binaryConvert == null) { if (binaryConvert == null || (!runner.mergemsg && (series || !this.last))) {
this.receiveMessage = this.getReceiveBytes(buffers); this.receiveMessage = this.getReceiveBytes(buffers);
this.receiveType = MessageType.BYTES; this.receiveType = MessageType.BYTES;
} else { } else {