Correct payload-length when parsing RTSP Messages
This commit is contained in:
parent
e60a7ef75f
commit
bb004e8cb2
1 changed files with 3 additions and 3 deletions
|
|
@ -210,11 +210,11 @@ int parseRtspMessage(PRTSP_MESSAGE msg, char* rtspMessage, int length) {
|
||||||
// Package the new parsed message into the struct
|
// Package the new parsed message into the struct
|
||||||
if (flag == TYPE_REQUEST) {
|
if (flag == TYPE_REQUEST) {
|
||||||
createRtspRequest(msg, messageBuffer, FLAG_ALLOCATED_MESSAGE_BUFFER | FLAG_ALLOCATED_OPTION_ITEMS, command, target,
|
createRtspRequest(msg, messageBuffer, FLAG_ALLOCATED_MESSAGE_BUFFER | FLAG_ALLOCATED_OPTION_ITEMS, command, target,
|
||||||
protocol, sequenceNum, options, payload, payload ? length - (int)(messageBuffer - payload) : 0);
|
protocol, sequenceNum, options, payload, payload ? length - (int)(payload - messageBuffer) : 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
createRtspResponse(msg, messageBuffer, FLAG_ALLOCATED_MESSAGE_BUFFER | FLAG_ALLOCATED_OPTION_ITEMS, protocol, statusCode,
|
createRtspResponse(msg, messageBuffer, FLAG_ALLOCATED_MESSAGE_BUFFER | FLAG_ALLOCATED_OPTION_ITEMS, protocol, statusCode,
|
||||||
statusStr, sequenceNum, options, payload, payload ? length - (int)(messageBuffer - payload) : 0);
|
statusStr, sequenceNum, options, payload, payload ? length - (int)(payload - messageBuffer) : 0);
|
||||||
}
|
}
|
||||||
return RTSP_ERROR_SUCCESS;
|
return RTSP_ERROR_SUCCESS;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue