Merge pull request #5294 from eclipse/jetty-9.4.x-5246-gziphandler-deflaterpool-dump

Issue #5246 - Adding DeflaterPool to GzipHandler.dump
This commit is contained in:
Joakim Erdfelt 2020-09-22 08:41:47 -05:00 committed by GitHub
commit 74e93715c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -421,6 +421,7 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory
protected void doStart() throws Exception
{
_deflaterPool = newDeflaterPool(_poolCapacity);
addBean(_deflaterPool);
_vary = (_agentPatterns.size() > 0) ? GzipHttpOutputInterceptor.VARY_ACCEPT_ENCODING_USER_AGENT : GzipHttpOutputInterceptor.VARY_ACCEPT_ENCODING;
super.doStart();
}

View File

@ -125,4 +125,17 @@ public abstract class CompressionPool<T> extends AbstractLifeCycle
}
_numObjects.set(0);
}
@Override
public String toString()
{
StringBuilder str = new StringBuilder();
str.append(getClass().getSimpleName());
str.append('@').append(Integer.toHexString(hashCode()));
str.append('{').append(getState());
str.append(",size=").append(_pool == null ? -1 : _pool.size());
str.append(",capacity=").append(_capacity <= 0 ? "UNLIMITED" : _capacity);
str.append('}');
return str.toString();
}
}