1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

reorder the config functions. add comments for st to support 100k threads, use MALLOC_STACK macro.

This commit is contained in:
winlin 2014-08-27 12:28:05 +08:00
parent 42a43c69cd
commit 839101a036
3 changed files with 28 additions and 26 deletions

4
trunk/configure vendored
View file

@ -283,7 +283,7 @@ install-api: install
@sed -i "s|^ROOT=.*|ROOT=\"\$(SRS_PREFIX)\"|g" \$(__REAL_INSTALL)/etc/init.d/srs-api @sed -i "s|^ROOT=.*|ROOT=\"\$(SRS_PREFIX)\"|g" \$(__REAL_INSTALL)/etc/init.d/srs-api
@echo "" @echo ""
@echo "api installed, to link and start api:" @echo "api installed, to link and start api:"
@echo " sudo ln -sf /usr/local/srs/etc/init.d/srs-api /etc/init.d/srs-api" @echo " sudo ln -sf \$(SRS_PREFIX)/etc/init.d/srs-api /etc/init.d/srs-api"
@echo " /etc/init.d/srs-api start" @echo " /etc/init.d/srs-api start"
@echo " http://\$(shell bash auto/local_ip.sh):8085" @echo " http://\$(shell bash auto/local_ip.sh):8085"
@echo "@see: https://github.com/winlinvip/simple-rtmp-server/wiki/LinuxService" @echo "@see: https://github.com/winlinvip/simple-rtmp-server/wiki/LinuxService"
@ -306,7 +306,7 @@ install:
@sed -i "s|^ROOT=.*|ROOT=\"\$(SRS_PREFIX)\"|g" \$(__REAL_INSTALL)/etc/init.d/srs @sed -i "s|^ROOT=.*|ROOT=\"\$(SRS_PREFIX)\"|g" \$(__REAL_INSTALL)/etc/init.d/srs
@echo "" @echo ""
@echo "srs installed, to link and start srs:" @echo "srs installed, to link and start srs:"
@echo " sudo ln -sf /usr/local/srs/etc/init.d/srs /etc/init.d/srs" @echo " sudo ln -sf \$(SRS_PREFIX)/etc/init.d/srs /etc/init.d/srs"
@echo " /etc/init.d/srs start" @echo " /etc/init.d/srs start"
@echo "@see: https://github.com/winlinvip/simple-rtmp-server/wiki/LinuxService" @echo "@see: https://github.com/winlinvip/simple-rtmp-server/wiki/LinuxService"

View file

@ -2746,6 +2746,30 @@ string SrsConfig::get_ingest_input_url(SrsConfDirective* ingest)
return conf->arg0(); return conf->arg0();
} }
bool SrsConfig::get_log_tank_file()
{
srs_assert(root);
SrsConfDirective* conf = root->get("srs_log_tank");
if (conf && conf->arg0() == SRS_CONF_DEFAULT_LOG_TANK_CONSOLE) {
return false;
}
return true;
}
string SrsConfig::get_log_level()
{
srs_assert(root);
SrsConfDirective* conf = root->get("srs_log_level");
if (!conf || conf->arg0().empty()) {
return SRS_CONF_DEFAULT_LOG_LEVEL;
}
return conf->arg0();
}
string SrsConfig::get_log_file() string SrsConfig::get_log_file()
{ {
srs_assert(root); srs_assert(root);
@ -2776,30 +2800,6 @@ string SrsConfig::get_ffmpeg_log_dir()
return conf->arg0(); return conf->arg0();
} }
string SrsConfig::get_log_level()
{
srs_assert(root);
SrsConfDirective* conf = root->get("srs_log_level");
if (!conf || conf->arg0().empty()) {
return SRS_CONF_DEFAULT_LOG_LEVEL;
}
return conf->arg0();
}
bool SrsConfig::get_log_tank_file()
{
srs_assert(root);
SrsConfDirective* conf = root->get("srs_log_tank");
if (conf && conf->arg0() == SRS_CONF_DEFAULT_LOG_TANK_CONSOLE) {
return false;
}
return true;
}
SrsConfDirective* SrsConfig::get_hls(string vhost) SrsConfDirective* SrsConfig::get_hls(string vhost)
{ {
SrsConfDirective* conf = get_vhost(vhost); SrsConfDirective* conf = get_vhost(vhost);

View file

@ -545,6 +545,8 @@ int SrsServer::initialize_st()
} }
srs_verbose("st_set_eventsys use linux epoll success"); srs_verbose("st_set_eventsys use linux epoll success");
// @remark, st alloc segment use mmap, which only support 32757 threads,
// if need to support more, for instance, 100k threads, define the macro MALLOC_STACK.
if(st_init() != 0){ if(st_init() != 0){
ret = ERROR_ST_INITIALIZE; ret = ERROR_ST_INITIALIZE;
srs_error("st_init failed. ret=%d", ret); srs_error("st_init failed. ret=%d", ret);