From af720d5a5bbb9048604d2af082a08e1d71f1076f Mon Sep 17 00:00:00 2001 From: Roger Baumgartner Date: Wed, 9 May 2018 18:03:23 +0200 Subject: [PATCH] Ignore CRC32 icon ID collisions in uploadIcon and uploadIconDirect If a query attempts to upload an icon that already exists on the server, the query should ignore the "file already exists" error and return the icon ID as if the upload had succeeded. The chance of an actual CRC32 collision, where two different icons are mapped to the same icon ID, is so tiny that we may as well ignore it. --- .../java/com/github/theholywaffle/teamspeak3/TS3ApiAsync.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/theholywaffle/teamspeak3/TS3ApiAsync.java b/src/main/java/com/github/theholywaffle/teamspeak3/TS3ApiAsync.java index e747d06e..6f70789a 100644 --- a/src/main/java/com/github/theholywaffle/teamspeak3/TS3ApiAsync.java +++ b/src/main/java/com/github/theholywaffle/teamspeak3/TS3ApiAsync.java @@ -5132,7 +5132,7 @@ public CommandFuture uploadIconDirect(byte[] data) { public void handleSuccess(Void ignored) { future.set(iconId); } - }).forwardFailure(future); + }).onFailure(transformError(future, 2050, iconId)); return future; }