Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2014-07-31 23:02:10 +0000
committerGreg Wilkins2014-07-31 23:02:10 +0000
commit77b80779105a1eb80966b6230c752a167f0d1115 (patch)
tree17ce13caec52da20b6691f5d988c8eaed3cf27c2 /jetty-servlets
parent093eea62b949d6b0df4c83a858af12200ea40c8b (diff)
downloadorg.eclipse.jetty.project-77b80779105a1eb80966b6230c752a167f0d1115.tar.gz
org.eclipse.jetty.project-77b80779105a1eb80966b6230c752a167f0d1115.tar.xz
org.eclipse.jetty.project-77b80779105a1eb80966b6230c752a167f0d1115.zip
435322 Fix AsyncGzipFilter missing callback on empty content
Diffstat (limited to 'jetty-servlets')
-rw-r--r--jetty-servlets/src/main/java/org/eclipse/jetty/servlets/AsyncGzipFilter.java2
-rw-r--r--jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHttpOutput.java13
2 files changed, 10 insertions, 5 deletions
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/AsyncGzipFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/AsyncGzipFilter.java
index 7b62a57bd7..d4737b3515 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/AsyncGzipFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/AsyncGzipFilter.java
@@ -135,7 +135,7 @@ public class AsyncGzipFilter extends UserAgentFilter implements GzipFactory
protected ServletContext _context;
protected final Set<String> _mimeTypes=new HashSet<>();
protected boolean _excludeMimeTypes;
- protected int _bufferSize=8192;
+ protected int _bufferSize=32*1024;
protected int _minGzipSize=DEFAULT_MIN_GZIP_SIZE;
protected int _deflateCompressionLevel=Deflater.DEFAULT_COMPRESSION;
protected boolean _deflateNoWrap = true;
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHttpOutput.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHttpOutput.java
index 636eab2b53..47136b9cbd 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHttpOutput.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHttpOutput.java
@@ -78,14 +78,16 @@ public class GzipHttpOutput extends HttpOutput
break;
case COMMITTING:
- throw new WritePendingException();
+ callback.failed(new WritePendingException());
+ break;
case COMPRESSING:
gzip(content,complete,callback);
break;
- case FINISHED:
- throw new IllegalStateException();
+ default:
+ callback.failed(new IllegalStateException("state="+_state.get()));
+ break;
}
}
@@ -122,6 +124,8 @@ public class GzipHttpOutput extends HttpOutput
else
new GzipBufferCB(content,complete,callback).iterate();
}
+ else
+ callback.succeeded();
}
protected void commit(ByteBuffer content, boolean complete, Callback callback)
@@ -198,7 +202,8 @@ public class GzipHttpOutput extends HttpOutput
gzip(content,complete,callback);
}
- // TODO else ?
+ else
+ callback.failed(new WritePendingException());
}
public void noCompression()

Back to the top