The fix for RtspResponseDecoder should be applied to all RTSP decoders

This commit is contained in:
Trustin Lee 2010-05-19 07:51:38 +00:00
parent 0c9202ab75
commit d51ccd2211
2 changed files with 14 additions and 14 deletions

View File

@ -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;
}
}

View File

@ -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;