mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add utest for config full.conf, fix the chunk-size bug
This commit is contained in:
parent
ffa72d3522
commit
f1b1dc0c64
3 changed files with 1073 additions and 8 deletions
|
@ -1587,27 +1587,38 @@ SrsConfDirective* SrsConfig::get_refer_publish(string vhost)
|
|||
|
||||
int SrsConfig::get_chunk_size(string vhost)
|
||||
{
|
||||
if (vhost.empty()) {
|
||||
return get_global_chunk_size();
|
||||
}
|
||||
|
||||
SrsConfDirective* conf = get_vhost(vhost);
|
||||
|
||||
if (!conf) {
|
||||
return SRS_CONSTS_RTMP_SRS_CHUNK_SIZE;
|
||||
// vhost does not specify the chunk size,
|
||||
// use the global instead.
|
||||
return get_global_chunk_size();
|
||||
}
|
||||
|
||||
conf = conf->get("chunk_size");
|
||||
if (!conf) {
|
||||
// vhost does not specify the chunk size,
|
||||
// use the global instead.
|
||||
conf = root->get("chunk_size");
|
||||
if (!conf) {
|
||||
return SRS_CONSTS_RTMP_SRS_CHUNK_SIZE;
|
||||
}
|
||||
|
||||
return ::atoi(conf->arg0().c_str());
|
||||
return get_global_chunk_size();
|
||||
}
|
||||
|
||||
return ::atoi(conf->arg0().c_str());
|
||||
}
|
||||
|
||||
int SrsConfig::get_global_chunk_size()
|
||||
{
|
||||
SrsConfDirective* conf = root->get("chunk_size");
|
||||
if (!conf) {
|
||||
return SRS_CONSTS_RTMP_SRS_CHUNK_SIZE;
|
||||
}
|
||||
|
||||
return ::atoi(conf->arg0().c_str());
|
||||
}
|
||||
|
||||
SrsConfDirective* SrsConfig::get_forward(string vhost)
|
||||
{
|
||||
SrsConfDirective* conf = get_vhost(vhost);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue