mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 01:15:46 +00:00
Merge pull request #48 from loki-47-6F-64/master
Correct payload-length when parsing RTSP Messages
This commit is contained in:
commit
3ccacdd3be
@ -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