mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 01:15:46 +00:00
Correct payload-length when parsing RTSP Messages
This commit is contained in:
parent
e60a7ef75f
commit
bb004e8cb2
@ -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…
x
Reference in New Issue
Block a user