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
2013-11-10 12:00:01 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b855caa045c11f7b9c88f57053da3bc921b9cc7b
b855caa0
1 parent
3669419e
refine handshake, pithy print clock
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
12 行增加
和
9 行删除
trunk/src/core/srs_core_client.cpp
trunk/src/core/srs_core_handshake.cpp
trunk/src/core/srs_core_handshake.hpp
trunk/src/core/srs_core_rtmp.cpp
trunk/src/core/srs_core_client.cpp
查看文件 @
b855caa
...
...
@@ -291,7 +291,7 @@ int SrsClient::playing(SrsSource* source)
// reportable
if
(
pithy_print
.
can_print
())
{
srs_trace
(
"-> clock=%u, time=%"
PRId64
", cmr=%d, msgs=%d, obytes=%"
PRId64
", ibytes=%"
PRId64
", okbps=%d, ikbps=%d"
,
(
int
)
srs_get_system_time_ms
(
),
pithy_print
.
get_age
(),
ctl_msg_ret
,
count
,
rtmp
->
get_send_bytes
(),
rtmp
->
get_recv_bytes
(),
rtmp
->
get_send_kbps
(),
rtmp
->
get_recv_kbps
());
(
int
)
(
srs_get_system_time_ms
()
/
1000
),
pithy_print
.
get_age
(),
ctl_msg_ret
,
count
,
rtmp
->
get_send_bytes
(),
rtmp
->
get_recv_bytes
(),
rtmp
->
get_send_kbps
(),
rtmp
->
get_recv_kbps
());
}
if
(
count
<=
0
)
{
...
...
@@ -347,7 +347,7 @@ int SrsClient::publish(SrsSource* source, bool is_fmle)
// reportable
if
(
pithy_print
.
can_print
())
{
srs_trace
(
"<- clock=%u, time=%"
PRId64
", obytes=%"
PRId64
", ibytes=%"
PRId64
", okbps=%d, ikbps=%d"
,
(
int
)
srs_get_system_time_ms
(
),
pithy_print
.
get_age
(),
rtmp
->
get_send_bytes
(),
rtmp
->
get_recv_bytes
(),
rtmp
->
get_send_kbps
(),
rtmp
->
get_recv_kbps
());
(
int
)
(
srs_get_system_time_ms
()
/
1000
),
pithy_print
.
get_age
(),
rtmp
->
get_send_bytes
(),
rtmp
->
get_recv_bytes
(),
rtmp
->
get_send_kbps
(),
rtmp
->
get_recv_kbps
());
}
// process audio packet
...
...
trunk/src/core/srs_core_handshake.cpp
查看文件 @
b855caa
...
...
@@ -1066,7 +1066,7 @@ SrsSimpleHandshake::~SrsSimpleHandshake()
{
}
int
SrsSimpleHandshake
::
handshake
(
SrsSocket
&
skt
)
int
SrsSimpleHandshake
::
handshake
(
SrsSocket
&
skt
,
SrsComplexHandshake
&
complex_hs
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -1089,8 +1089,7 @@ int SrsSimpleHandshake::handshake(SrsSocket& skt)
srs_verbose
(
"check c0 success, required plain text."
);
// try complex handshake
SrsComplexHandshake
complex_handshake
;
ret
=
complex_handshake
.
handshake
(
skt
,
c0c1
+
1
);
ret
=
complex_hs
.
handshake
(
skt
,
c0c1
+
1
);
if
(
ret
==
ERROR_SUCCESS
)
{
srs_trace
(
"complex handshake success."
);
return
ret
;
...
...
@@ -1099,7 +1098,7 @@ int SrsSimpleHandshake::handshake(SrsSocket& skt)
srs_error
(
"complex handshake failed. ret=%d"
,
ret
);
return
ret
;
}
srs_info
(
"
complex handhskae failed, try simpl
e. ret=%d"
,
ret
);
srs_info
(
"
rollback complex to simple handshak
e. ret=%d"
,
ret
);
char
*
s0s1s2
=
new
char
[
3073
];
SrsAutoFree
(
char
,
s0s1s2
,
true
);
...
...
trunk/src/core/srs_core_handshake.hpp
查看文件 @
b855caa
...
...
@@ -31,6 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core.hpp>
class
SrsSocket
;
class
SrsComplexHandshake
;
/**
* try complex handshake, if failed, fallback to simple handshake.
...
...
@@ -43,8 +44,10 @@ public:
public
:
/**
* simple handshake.
* @param complex_hs, try complex handshake first,
* if failed, rollback to simple handshake.
*/
virtual
int
handshake
(
SrsSocket
&
skt
);
virtual
int
handshake
(
SrsSocket
&
skt
,
SrsComplexHandshake
&
complex_hs
);
};
/**
...
...
trunk/src/core/srs_core_rtmp.cpp
查看文件 @
b855caa
...
...
@@ -225,8 +225,9 @@ int SrsRtmp::handshake()
SrsSocket
skt
(
stfd
);
SrsSimpleHandshake
hs
;
if
((
ret
=
hs
.
handshake
(
skt
))
!=
ERROR_SUCCESS
)
{
SrsComplexHandshake
complex_hs
;
SrsSimpleHandshake
simple_hs
;
if
((
ret
=
simple_hs
.
handshake
(
skt
,
complex_hs
))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
...
...
请
注册
或
登录
后发表评论