Skip to content

Commit 78e9218

Browse files
committed
handle corrupted replay
1 parent d1f82fa commit 78e9218

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

scripts/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
#curl localhost:5600 --data-binary "@/datadrive/odota-parser/7355186741_1742953546.dem"
44
#curl localhost:5600 --data-binary "@/datadrive/odota-parser/6298221747_1156784242.dem"
55

6-
curl localhost:5600/blob?replay_url=http://replay118.valve.net/570/8218938996_1424352668.dem.bz2
6+
curl localhost:5600/blob?replay_url=http://replay133.valve.net/570/2646802030_215184658.dem.bz2

src/main/java/opendota/Main.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ public void handle(HttpExchange t) throws IOException {
101101
// Corrupted replay, don't retry
102102
status = 200;
103103
}
104+
if (error.toString().contains("bunzip2: Compressed file ends unexpectedly")) {
105+
// Corrupted replay, don't retry
106+
status = 200;
107+
}
104108
if (error.toString().contains("bunzip2: (stdin) is not a bzip2 file.")) {
105109
// Tried to unzip a non-bz2 file
106110
status = 200;

0 commit comments

Comments
 (0)