Переименованы поля
This commit is contained in:
@@ -22,6 +22,6 @@ public class CtfService {
|
||||
|
||||
private boolean mergeAdjacentPackets;
|
||||
|
||||
private boolean inflateWebSockets;
|
||||
private boolean parseWebSockets;
|
||||
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class Packet {
|
||||
|
||||
private boolean ungzipped;
|
||||
|
||||
private boolean webSocketInflated;
|
||||
private boolean webSocketParsed;
|
||||
|
||||
private byte[] content;
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ public class StreamOptimizer {
|
||||
unpackGzip();
|
||||
}
|
||||
|
||||
if (service.isInflateWebSockets()) {
|
||||
inflateWebSocket();
|
||||
if (service.isParseWebSockets()) {
|
||||
parseWebSockets();
|
||||
}
|
||||
|
||||
if (service.isUrldecodeHttpRequests()) {
|
||||
@@ -89,7 +89,7 @@ public class StreamOptimizer {
|
||||
final List<Packet> cut = packets.subList(start, end);
|
||||
final long timestamp = cut.get(0).getTimestamp();
|
||||
final boolean ungzipped = cut.stream().anyMatch(Packet::isUngzipped);
|
||||
final boolean webSocketInflated = cut.stream().anyMatch(Packet::isWebSocketInflated);
|
||||
final boolean webSocketParsed = cut.stream().anyMatch(Packet::isWebSocketParsed);
|
||||
boolean incoming = cut.get(0).isIncoming();
|
||||
//noinspection OptionalGetWithoutIsPresent
|
||||
final byte[] content = cut.stream()
|
||||
@@ -102,7 +102,7 @@ public class StreamOptimizer {
|
||||
.incoming(incoming)
|
||||
.timestamp(timestamp)
|
||||
.ungzipped(ungzipped)
|
||||
.webSocketInflated(webSocketInflated)
|
||||
.webSocketParsed(webSocketParsed)
|
||||
.content(content)
|
||||
.build());
|
||||
}
|
||||
@@ -223,7 +223,7 @@ public class StreamOptimizer {
|
||||
.incoming(false)
|
||||
.timestamp(cut.get(0).getTimestamp())
|
||||
.ungzipped(true)
|
||||
.webSocketInflated(false)
|
||||
.webSocketParsed(false)
|
||||
.content(newContent)
|
||||
.build();
|
||||
} catch (ZipException e) {
|
||||
@@ -235,7 +235,7 @@ public class StreamOptimizer {
|
||||
return null;
|
||||
}
|
||||
|
||||
private void inflateWebSocket() {
|
||||
private void parseWebSockets() {
|
||||
if (!packets.get(0).getContentString().contains("HTTP/")) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ public class WebSocketsParser {
|
||||
.timestamp(lastPacket.getTimestamp())
|
||||
.ttl(lastPacket.getTtl())
|
||||
.ungzipped(lastPacket.isUngzipped())
|
||||
.webSocketInflated(true)
|
||||
.webSocketParsed(true)
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user