mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-17 17:05:50 +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
|
||||
if (flag == TYPE_REQUEST) {
|
||||
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 {
|
||||
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;
|
||||
|
||||
@ -394,4 +394,4 @@ void freeMessage(PRTSP_MESSAGE msg) {
|
||||
if (msg->flags & FLAG_ALLOCATED_PAYLOAD) {
|
||||
free(msg->payload);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user