aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-04-05 11:42:57 +0200
committerDaniel Gultsch <daniel@gultsch.de>2014-04-05 11:42:57 +0200
commitc445b8f4ae8d86e75ba89798dae389b653313aef (patch)
treec9279e24e05b3f42168c7129f4a6e3176936e36e
parent850b24c4dbbed20cde68f6015be2a5b7f28fba93 (diff)
parentc82c6251b8c48692bb929436aa7ff0449b9e86f3 (diff)
Merge pull request #49 from rtreffer/compression-fix
Switch to FULL_SYNC to make prosody happy
-rw-r--r--src/eu/siacs/conversations/utils/zlib/ZLibOutputStream.java15
1 files changed, 5 insertions, 10 deletions
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");