private bool HandleRTSPMessage()
{
//1. Get the content
if (_contentLength > 0)
{
if (_contentLength > 1024 * 1024)
{
FATAL("Bogus content length: {0}", _contentLength);
return false;
}
var chunkLength = _contentLength - _inboundContent.Length;
chunkLength = InputBuffer.AvaliableByteCounts < chunkLength ? InputBuffer.AvaliableByteCounts : chunkLength;
_inboundContent += InputBuffer.Reader.ReadBytes((int) chunkLength).BytesToString();
if (_inboundContent.Length < _contentLength)
{
FINEST("Not enough data. Wanted: {0}; got: {1}", _contentLength, _inboundContent.Length);
return true;
}
}
//2. Call the protocol handler
var result = _inboundHeaders["isRequest"] ? _protocolHandler.HandleRTSPRequest(this, _inboundHeaders, _inboundContent) : _protocolHandler.HandleRTSPResponse(this, _inboundHeaders,ref _inboundContent);
_state = RtspState.Header;
return result;
}