[#539] Potential direct memory leak in HttpContentEn/Decoder
This commit is contained in:
parent
7f3f792017
commit
10f26f3205
@ -63,7 +63,10 @@ public abstract class HttpContentDecoder extends MessageToMessageDecoder<Object,
|
|||||||
} else if (msg instanceof HttpMessage) {
|
} else if (msg instanceof HttpMessage) {
|
||||||
HttpMessage m = (HttpMessage) msg;
|
HttpMessage m = (HttpMessage) msg;
|
||||||
|
|
||||||
decoder = null;
|
if (decoder != null) {
|
||||||
|
// Clean-up the previous decoder if not cleaned up correctly.
|
||||||
|
finishDecode(Unpooled.buffer());
|
||||||
|
}
|
||||||
|
|
||||||
// Determine the content encoding.
|
// Determine the content encoding.
|
||||||
String contentEncoding = m.getHeader(HttpHeaders.Names.CONTENT_ENCODING);
|
String contentEncoding = m.getHeader(HttpHeaders.Names.CONTENT_ENCODING);
|
||||||
|
@ -88,7 +88,10 @@ public abstract class HttpContentEncoder extends MessageToMessageCodec<HttpMessa
|
|||||||
} else if (msg instanceof HttpMessage) {
|
} else if (msg instanceof HttpMessage) {
|
||||||
HttpMessage m = (HttpMessage) msg;
|
HttpMessage m = (HttpMessage) msg;
|
||||||
|
|
||||||
encoder = null;
|
if (encoder != null) {
|
||||||
|
// Clean-up the previous encoder if not cleaned up correctly.
|
||||||
|
finishEncode(Unpooled.buffer());
|
||||||
|
}
|
||||||
|
|
||||||
// Determine the content encoding.
|
// Determine the content encoding.
|
||||||
String acceptEncoding = acceptEncodingQueue.poll();
|
String acceptEncoding = acceptEncodingQueue.poll();
|
||||||
|
Loading…
Reference in New Issue
Block a user