use of org.eclipse.jetty.websocket.api.BadPayloadException in project jetty.project by eclipse.
the class DeflateFrameExtension method incomingFrame.
@Override
public void incomingFrame(Frame frame) {
if (frame.getType().isControl() || !frame.isRsv1() || !frame.hasPayload()) {
nextIncomingFrame(frame);
return;
}
try {
ByteAccumulator accumulator = newByteAccumulator();
decompress(accumulator, frame.getPayload());
decompress(accumulator, TAIL_BYTES_BUF.slice());
forwardIncoming(frame, accumulator);
} catch (DataFormatException e) {
throw new BadPayloadException(e);
}
}
use of org.eclipse.jetty.websocket.api.BadPayloadException in project jetty.project by eclipse.
the class PerMessageDeflateExtension method incomingFrame.
@Override
public void incomingFrame(Frame frame) {
// Subsequent continuation frames don't have RSV1 set, but are compressed.
if (frame.getType().isData()) {
incomingCompressed = frame.isRsv1();
}
if (OpCode.isControlFrame(frame.getOpCode()) || !incomingCompressed) {
nextIncomingFrame(frame);
return;
}
ByteAccumulator accumulator = newByteAccumulator();
try {
ByteBuffer payload = frame.getPayload();
decompress(accumulator, payload);
if (frame.isFin()) {
decompress(accumulator, TAIL_BYTES_BUF.slice());
}
forwardIncoming(frame, accumulator);
} catch (DataFormatException e) {
throw new BadPayloadException(e);
}
if (frame.isFin())
incomingCompressed = false;
}
Aggregations