diff --git a/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspMessageDecoder.java b/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspMessageDecoder.java index 5c1cca9ae2..7cd028a86d 100644 --- a/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspMessageDecoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspMessageDecoder.java @@ -90,4 +90,18 @@ public abstract class RtspMessageDecoder extends HttpMessageDecoder { return null; } } + + @Override + protected boolean isContentAlwaysEmpty(HttpMessage msg) { + // Unlike HTTP, RTSP always assumes zero-length body if Content-Length + // header is absent. + boolean empty = super.isContentAlwaysEmpty(msg); + if (empty) { + return true; + } + if (!msg.containsHeader(RtspHeaders.Names.CONTENT_LENGTH)) { + return true; + } + return empty; + } } diff --git a/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspResponseDecoder.java b/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspResponseDecoder.java index 28086711f8..7f7dd15016 100644 --- a/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspResponseDecoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspResponseDecoder.java @@ -80,20 +80,6 @@ public class RtspResponseDecoder extends RtspMessageDecoder { new HttpResponseStatus(Integer.valueOf(initialLine[1]), initialLine[2])); } - @Override - protected boolean isContentAlwaysEmpty(HttpMessage msg) { - // Unlike HTTP, RTSP always assumes zero-length body if Content-Length - // header is absent. - boolean empty = super.isContentAlwaysEmpty(msg); - if (empty) { - return true; - } - if (!msg.containsHeader(RtspHeaders.Names.CONTENT_LENGTH)) { - return true; - } - return empty; - } - @Override protected boolean isDecodingRequest() { return false;