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-10-09 14:24:52 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2be014e4f501dff18023450ca0b0ab39023ba290
2be014e4
1 parent
fca500fa
remove the dead code for bug #180
显示空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
0 行增加
和
23 行删除
trunk/src/rtmp/srs_protocol_handshake.cpp
trunk/src/rtmp/srs_protocol_handshake.cpp
查看文件 @
2be014e
...
...
@@ -1263,17 +1263,12 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs
{
int
ret
=
ERROR_SUCCESS
;
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
SrsHandshakeBytes
*
ptr
=
hs_bytes
;
ssize_t
nsize
;
// complex handshake
if
((
ret
=
hs_bytes
->
create_c0c1
())
!=
ERROR_SUCCESS
)
{
return
ret
;
}
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
srs_assert
(
ptr
==
hs_bytes
);
// sign c1
c1s1
c1
;
...
...
@@ -1282,8 +1277,6 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs
return
ret
;
}
c1
.
dump
(
hs_bytes
->
c0c1
+
1
);
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
srs_assert
(
ptr
==
hs_bytes
);
// verify c1
bool
is_valid
;
...
...
@@ -1291,23 +1284,17 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs
ret
=
ERROR_RTMP_TRY_SIMPLE_HS
;
return
ret
;
}
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
srs_assert
(
ptr
==
hs_bytes
);
if
((
ret
=
io
->
write
(
hs_bytes
->
c0c1
,
1537
,
&
nsize
))
!=
ERROR_SUCCESS
)
{
srs_warn
(
"write c0c1 failed. ret=%d"
,
ret
);
return
ret
;
}
srs_verbose
(
"write c0c1 success."
);
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
srs_assert
(
ptr
==
hs_bytes
);
// s0s1s2
if
((
ret
=
hs_bytes
->
read_s0s1s2
(
io
))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
srs_assert
(
ptr
==
hs_bytes
);
// plain text required.
if
(
hs_bytes
->
s0s1s2
[
0
]
!=
0x03
)
{
...
...
@@ -1315,16 +1302,12 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs
srs_warn
(
"handshake failed, plain text required. ret=%d"
,
ret
);
return
ret
;
}
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
srs_assert
(
ptr
==
hs_bytes
);
// verify s1s2
c1s1
s1
;
if
((
ret
=
s1
.
parse
(
hs_bytes
->
s0s1s2
+
1
,
c1
.
schema
))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
srs_assert
(
ptr
==
hs_bytes
);
// never verify the s1,
// for if forward to nginx-rtmp, verify s1 will failed,
...
...
@@ -1334,15 +1317,11 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs
if
((
ret
=
hs_bytes
->
create_c2
())
!=
ERROR_SUCCESS
)
{
return
ret
;
}
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
srs_assert
(
ptr
==
hs_bytes
);
c2s2
c2
;
if
((
ret
=
c2
.
c2_create
(
&
s1
))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
srs_assert
(
ptr
==
hs_bytes
);
c2
.
dump
(
hs_bytes
->
c2
);
if
((
ret
=
io
->
write
(
hs_bytes
->
c2
,
1536
,
&
nsize
))
!=
ERROR_SUCCESS
)
{
...
...
@@ -1350,8 +1329,6 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs
return
ret
;
}
srs_verbose
(
"complex handshake write c2 success."
);
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
srs_assert
(
ptr
==
hs_bytes
);
srs_trace
(
"complex handshake success."
);
...
...
请
注册
或
登录
后发表评论