Skip to content

Commit f52148f

Browse files
authored
Merge pull request #237 from roaris/fix-single-packet-attack
single packet attack の修正
2 parents 3620c18 + f836ef7 commit f52148f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/core/packetproxy/controller/SinglePacketAttackController.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,11 @@ private void launchAttack(final int count) throws Exception {
120120
Thread.sleep(sleepTimeMs);
121121
sendPing();
122122

123+
final var allLastFramesData = new ByteArrayOutputStream();
123124
for (final var request : requests) {
124-
request.sendLastFrames();
125+
allLastFramesData.write(request.getLastFramesData());
125126
}
127+
attackConnection.execFastSend(allLastFramesData.toByteArray());
126128

127129
for (var i = 0; i < requests.size(); i++) {
128130
attackConnection.receive();
@@ -375,10 +377,8 @@ private void sendFirstFrames() throws Exception {
375377
connection.execFastSend(firstFramesData);
376378
}
377379

378-
private void sendLastFrames() throws Exception {
379-
final var lastFramesData = FrameUtils.toByteArray(streamAttackFrames.lastFrames);
380-
381-
connection.execFastSend(lastFramesData);
380+
private byte[] getLastFramesData() throws Exception {
381+
return FrameUtils.toByteArray(streamAttackFrames.lastFrames);
382382
}
383383
}
384384
}

0 commit comments

Comments
 (0)