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
2014-03-19 17:14:42 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
da93b6fe99de564ad8103afc959077e6dea709ba
da93b6fe
1 parent
491ea4b6
add complex handshake utest
显示空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
45 行增加
和
40 行删除
README.md
trunk/research/hls/ts_info.cc
trunk/research/librtmp/srs_play.c
trunk/research/librtmp/srs_publish.c
trunk/src/rtmp/srs_protocol_handshake.hpp
trunk/src/rtmp/srs_protocol_rtmp.cpp
README.md
查看文件 @
da93b6f
...
...
@@ -67,7 +67,7 @@ cd simple-rtmp-server/trunk
[
Usage: How to deploy low lantency application?
](
https://github.com/winlinvip/simple-rtmp-server/wiki/SampleRealtime
)
<br/>
[
Usage: How to deploy srs on ARM?
](
https://github.com/winlinvip/simple-rtmp-server/wiki/SampleARM
)
<br/>
[
Usage: How to show the demo of SRS?
](
https://github.com/winlinvip/simple-rtmp-server/wiki/SampleDemo
)
<br/>
[
Usage:
Who is
using SRS?
](
https://github.com/winlinvip/simple-rtmp-server/wiki/Sample
)
<br/>
[
Usage:
Solution
using SRS?
](
https://github.com/winlinvip/simple-rtmp-server/wiki/Sample
)
<br/>
### System Requirements
Supported operating systems and hardware:
...
...
trunk/research/hls/ts_info.cc
查看文件 @
da93b6f
trunk/research/librtmp/srs_play.c
查看文件 @
da93b6f
trunk/research/librtmp/srs_publish.c
查看文件 @
da93b6f
...
...
@@ -45,7 +45,8 @@ int main(int argc, char** argv)
rtmp
=
srs_rtmp_create
(
"rtmp://127.0.0.1:1935/live/livestream"
);
if
(
srs_simple_handshake
(
rtmp
)
!=
0
)
{
//if (srs_simple_handshake(rtmp) != 0) {
if
(
srs_complex_handshake
(
rtmp
)
!=
0
)
{
printf
(
"simple handshake failed.
\n
"
);
goto
rtmp_destroy
;
}
...
...
trunk/src/rtmp/srs_protocol_handshake.hpp
查看文件 @
da93b6f
...
...
@@ -34,43 +34,7 @@ class ISrsProtocolReaderWriter;
class
SrsComplexHandshake
;
class
SrsHandshakeBytes
;
/**
* try complex handshake, if failed, fallback to simple handshake.
*/
class
SrsSimpleHandshake
{
public
:
SrsSimpleHandshake
();
virtual
~
SrsSimpleHandshake
();
public
:
/**
* simple handshake.
*/
virtual
int
handshake_with_client
(
SrsHandshakeBytes
*
hs_bytes
,
ISrsProtocolReaderWriter
*
io
);
virtual
int
handshake_with_server
(
SrsHandshakeBytes
*
hs_bytes
,
ISrsProtocolReaderWriter
*
io
);
};
/**
* rtmp complex handshake,
* @see also crtmp(crtmpserver) or librtmp,
* @see also: http://blog.csdn.net/win_lin/article/details/13006803
*/
class
SrsComplexHandshake
{
public
:
SrsComplexHandshake
();
virtual
~
SrsComplexHandshake
();
public
:
/**
* complex hanshake.
* @return user must:
* continue connect app if success,
* try simple handshake if error is ERROR_RTMP_TRY_SIMPLE_HS,
* otherwise, disconnect
*/
virtual
int
handshake_with_client
(
SrsHandshakeBytes
*
hs_bytes
,
ISrsProtocolReaderWriter
*
io
);
virtual
int
handshake_with_server
(
SrsHandshakeBytes
*
hs_bytes
,
ISrsProtocolReaderWriter
*
io
);
};
#ifdef SRS_SSL
namespace
srs
{
...
...
@@ -304,3 +268,43 @@ namespace srs
}
#endif
/**
* try complex handshake, if failed, fallback to simple handshake.
*/
class
SrsSimpleHandshake
{
public
:
SrsSimpleHandshake
();
virtual
~
SrsSimpleHandshake
();
public
:
/**
* simple handshake.
*/
virtual
int
handshake_with_client
(
SrsHandshakeBytes
*
hs_bytes
,
ISrsProtocolReaderWriter
*
io
);
virtual
int
handshake_with_server
(
SrsHandshakeBytes
*
hs_bytes
,
ISrsProtocolReaderWriter
*
io
);
};
/**
* rtmp complex handshake,
* @see also crtmp(crtmpserver) or librtmp,
* @see also: http://blog.csdn.net/win_lin/article/details/13006803
*/
class
SrsComplexHandshake
{
public
:
SrsComplexHandshake
();
virtual
~
SrsComplexHandshake
();
public
:
/**
* complex hanshake.
* @return user must:
* continue connect app if success,
* try simple handshake if error is ERROR_RTMP_TRY_SIMPLE_HS,
* otherwise, disconnect
*/
virtual
int
handshake_with_client
(
SrsHandshakeBytes
*
hs_bytes
,
ISrsProtocolReaderWriter
*
io
);
virtual
int
handshake_with_server
(
SrsHandshakeBytes
*
hs_bytes
,
ISrsProtocolReaderWriter
*
io
);
};
#endif
\ No newline at end of file
...
...
trunk/src/rtmp/srs_protocol_rtmp.cpp
查看文件 @
da93b6f
...
...
@@ -229,7 +229,7 @@ int SrsHandshakeBytes::read_s0s1s2(ISrsProtocolReaderWriter* io)
ssize_t
nsize
;
c0c1
=
new
char
[
3073
];
s0s1s2
=
new
char
[
3073
];
if
((
ret
=
io
->
read_fully
(
s0s1s2
,
3073
,
&
nsize
))
!=
ERROR_SUCCESS
)
{
srs_warn
(
"read s0s1s2 failed. ret=%d"
,
ret
);
return
ret
;
...
...
请
注册
或
登录
后发表评论