Issue #5246 - Adding DeflaterPool to GzipHandler.dump

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2020-09-17 10:27:15 -05:00
parent 0db3663a11
commit 6cf6b78a16
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
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();
}
}