From c82c6251b8c48692bb929436aa7ff0449b9e86f3 Mon Sep 17 00:00:00 2001 From: Rene Treffer Date: Sat, 5 Apr 2014 11:39:45 +0200 Subject: Switch to FULL_SYNC to make prosody happy --- .../siacs/conversations/utils/zlib/ZLibOutputStream.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/eu') diff --git a/src/eu/siacs/conversations/utils/zlib/ZLibOutputStream.java b/src/eu/siacs/conversations/utils/zlib/ZLibOutputStream.java index f2bff9fd..cc64a5e6 100644 --- a/src/eu/siacs/conversations/utils/zlib/ZLibOutputStream.java +++ b/src/eu/siacs/conversations/utils/zlib/ZLibOutputStream.java @@ -63,18 +63,13 @@ public class ZLibOutputStream extends DeflaterOutputStream { super.flush(); return; } - int count = 0; - if (!def.needsInput()) { - do { - count = def.deflate(buf, 0, buf.length); - out.write(buf, 0, count); - } while (count > 0); - out.flush(); - } try { + int count = 0; do { - count = (Integer) method.invoke(def, buf, 0, buf.length, 2); - out.write(buf, 0, count); + count = (Integer) method.invoke(def, buf, 0, buf.length, 3); + if (count > 0) { + out.write(buf, 0, count); + } } while (count > 0); } catch (IllegalArgumentException e) { throw new IOException("Can't flush"); -- cgit v1.2.3