Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2017-01-06 13:16:25 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
dc1f227aeb8ca17b7e45882c98a1156ef418558e
dc1f227a
1 parent
759c84a3
for #730, refine code to decode the acknowledge message
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
21 行增加
和
2 行删除
trunk/src/protocol/srs_rtmp_stack.cpp
trunk/src/protocol/srs_rtmp_stack.hpp
trunk/src/utest/srs_utest_core.cpp
trunk/src/protocol/srs_rtmp_stack.cpp
查看文件 @
dc1f227
...
...
@@ -5017,6 +5017,22 @@ SrsAcknowledgementPacket::~SrsAcknowledgementPacket()
{
}
int
SrsAcknowledgementPacket
::
decode
(
SrsBuffer
*
stream
)
{
int
ret
=
ERROR_SUCCESS
;
if
(
!
stream
->
require
(
4
))
{
ret
=
ERROR_RTMP_MESSAGE_DECODE
;
srs_error
(
"decode acknowledgement failed. ret=%d"
,
ret
);
return
ret
;
}
sequence_number
=
stream
->
read_4bytes
();
srs_info
(
"decode acknowledgement success"
);
return
ret
;
}
int
SrsAcknowledgementPacket
::
get_prefer_cid
()
{
return
RTMP_CID_ProtocolControl
;
...
...
trunk/src/protocol/srs_rtmp_stack.hpp
查看文件 @
dc1f227
...
...
@@ -1847,6 +1847,9 @@ public:
public
:
SrsAcknowledgementPacket
();
virtual
~
SrsAcknowledgementPacket
();
// decode functions for concrete packet to override.
public:
virtual
int
decode
(
SrsBuffer
*
stream
);
// encode functions for concrete packet to override.
public:
virtual
int
get_prefer_cid
();
...
...
trunk/src/utest/srs_utest_core.cpp
查看文件 @
dc1f227
...
...
@@ -31,12 +31,12 @@ using namespace std;
VOID
TEST
(
CoreAutoFreeTest
,
Free
)
{
char
*
data
=
new
char
[
32
];
srs_freep
(
data
);
srs_freep
a
(
data
);
EXPECT_TRUE
(
data
==
NULL
);
if
(
true
)
{
data
=
new
char
[
32
];
SrsAutoFree
(
char
,
data
);
SrsAutoFree
A
(
char
,
data
);
}
EXPECT_TRUE
(
data
==
NULL
);
}
...
...
请
注册
或
登录
后发表评论