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-02-19 14:54:04 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
39f15ba3daf95cfad7babb11d376342abefe46a3
39f15ba3
1 parent
73b298ca
refine the comments, fix bug of parse message
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
13 行增加
和
3 行删除
trunk/src/core/srs_core_client.cpp
trunk/src/core/srs_core_protocol.cpp
trunk/src/core/srs_core_client.cpp
查看文件 @
39f15ba
...
...
@@ -215,7 +215,7 @@ int SrsClient::stream_service_cycle()
rtmp
->
set_recv_timeout
(
SRS_RECV_TIMEOUT_US
);
rtmp
->
set_send_timeout
(
SRS_SEND_TIMEOUT_US
);
// set
timeout
to larger.
// set
chunk size
to larger.
int
chunk_size
=
config
->
get_chunk_size
(
req
->
vhost
);
if
((
ret
=
rtmp
->
set_chunk_size
(
chunk_size
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"set chunk_size=%d failed. ret=%d"
,
chunk_size
,
ret
);
...
...
@@ -223,7 +223,7 @@ int SrsClient::stream_service_cycle()
}
srs_trace
(
"set chunk_size=%d success"
,
chunk_size
);
// find a source to
publish
.
// find a source to
serve
.
SrsSource
*
source
=
SrsSource
::
find
(
req
);
srs_assert
(
source
!=
NULL
);
...
...
trunk/src/core/srs_core_protocol.cpp
查看文件 @
39f15ba
...
...
@@ -173,7 +173,8 @@ messages.
* independently for each direction.
*/
#define RTMP_DEFAULT_CHUNK_SIZE 128
#define RTMP_MIN_CHUNK_SIZE 2
#define RTMP_MIN_CHUNK_SIZE 128
#define RTMP_MAX_CHUNK_SIZE 65536
/**
* 6.1. Chunk Format
...
...
@@ -1279,6 +1280,9 @@ int SrsCommonMessage::decode_packet(SrsProtocol* protocol)
// reset stream, for header read completed.
stream
->
reset
();
if
(
header
.
is_amf3_command
())
{
stream
->
skip
(
1
);
}
std
::
string
request_name
=
protocol
->
get_request_name
(
transactionId
);
if
(
request_name
.
empty
())
{
...
...
@@ -3201,6 +3205,12 @@ int SrsSetChunkSizePacket::decode(SrsStream* stream)
ERROR_RTMP_CHUNK_SIZE
,
chunk_size
,
ret
);
return
ret
;
}
if
(
chunk_size
>
RTMP_MAX_CHUNK_SIZE
)
{
ret
=
ERROR_RTMP_CHUNK_SIZE
;
srs_error
(
"invalid chunk size. max=%d, actual=%d, ret=%d"
,
RTMP_MAX_CHUNK_SIZE
,
chunk_size
,
ret
);
return
ret
;
}
return
ret
;
}
...
...
请
注册
或
登录
后发表评论