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-09-26 17:47:43 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
20ebf68ea5d43b2044c03240492b04348aa1e92e
20ebf68e
1 parent
002facb8
fix hls bug, refine config and log, according to clion of jetbrains. 0.9.216.
显示空白字符变更
内嵌
并排对比
正在显示
7 个修改的文件
包含
48 行增加
和
19 行删除
README.md
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_config.hpp
trunk/src/app/srs_app_pithy_print.cpp
trunk/src/app/srs_app_pithy_print.hpp
trunk/src/core/srs_core.hpp
trunk/src/main/srs_main_server.cpp
README.md
查看文件 @
20ebf68
...
...
@@ -208,6 +208,7 @@ Supported operating systems and hardware:
*
2013-10-17, Created.
<br/>
## History
*
v1.0, 2014-09-26, fix hls bug, refine config and log, according to clion of jetbrains. 0.9.216.
*
v1.0, 2014-09-25, fix
[
#177
](
https://github.com/winlinvip/simple-rtmp-server/issues/177
)
, dvr segment add config dvr_wait_keyframe. 0.9.213.
*
v1.0, 2014-08-28, fix
[
#167
](
https://github.com/winlinvip/simple-rtmp-server/issues/167
)
, add openssl includes to utest. 0.9.209.
*
v1.0, 2014-08-27, max connections is 32756, for st use mmap default. 0.9.209
...
...
trunk/src/app/srs_app_config.cpp
查看文件 @
20ebf68
...
...
@@ -50,16 +50,6 @@ using namespace _srs_internal;
#define SRS_WIKI_URL_LOG "https://github.com/winlinvip/simple-rtmp-server/wiki/SrsLog"
#define FILE_OFFSET(fd) lseek(fd, 0, SEEK_CUR)
int64_t
FILE_SIZE
(
int
fd
)
{
int64_t
pre
=
FILE_OFFSET
(
fd
);
int64_t
pos
=
lseek
(
fd
,
0
,
SEEK_END
);
lseek
(
fd
,
pre
,
SEEK_SET
);
return
pos
;
}
// '\n'
#define __LF (char)0x0a
...
...
@@ -407,6 +397,7 @@ int SrsConfig::reload()
int
ret
=
ERROR_SUCCESS
;
SrsConfig
conf
;
if
((
ret
=
conf
.
parse_file
(
config_file
.
c_str
()))
!=
ERROR_SUCCESS
)
{
srs_error
(
"ignore config reloader parse file failed. ret=%d"
,
ret
);
ret
=
ERROR_SUCCESS
;
...
...
@@ -414,6 +405,12 @@ int SrsConfig::reload()
}
srs_info
(
"config reloader parse file success."
);
if
((
ret
=
conf
.
check_config
())
!=
ERROR_SUCCESS
)
{
srs_error
(
"ignore config reloader check config failed. ret=%d"
,
ret
);
ret
=
ERROR_SUCCESS
;
return
ret
;
}
return
reload_conf
(
&
conf
);
}
...
...
@@ -1074,6 +1071,12 @@ int SrsConfig::parse_options(int argc, char** argv)
ret
=
parse_file
(
config_file
.
c_str
());
if
(
test_conf
)
{
// the parse_file never check the config,
// we check it when user requires check config file.
if
(
ret
==
ERROR_SUCCESS
)
{
ret
=
check_config
();
}
if
(
ret
==
ERROR_SUCCESS
)
{
srs_trace
(
"config file is ok"
);
exit
(
0
);
...
...
@@ -1083,6 +1086,25 @@ int SrsConfig::parse_options(int argc, char** argv)
}
}
////////////////////////////////////////////////////////////////////////
// check log name and level
////////////////////////////////////////////////////////////////////////
if
(
true
)
{
std
::
string
log_filename
=
this
->
get_log_file
();
if
(
get_log_tank_file
()
&&
log_filename
.
empty
())
{
ret
=
ERROR_SYSTEM_CONFIG_INVALID
;
srs_error
(
"must specifies the file to write log to. ret=%d"
,
ret
);
return
ret
;
}
if
(
get_log_tank_file
())
{
srs_trace
(
"write log to file %s"
,
log_filename
.
c_str
());
srs_trace
(
"you can: tailf %s"
,
log_filename
.
c_str
());
srs_trace
(
"@see: %s"
,
SRS_WIKI_URL_LOG
);
}
else
{
srs_trace
(
"write log to console"
);
}
}
return
ret
;
}
...
...
@@ -1190,6 +1212,8 @@ int SrsConfig::check_config()
{
int
ret
=
ERROR_SUCCESS
;
srs_trace
(
"srs checking config..."
);
vector
<
SrsConfDirective
*>
vhosts
=
get_vhosts
();
////////////////////////////////////////////////////////////////////////
...
...
@@ -1629,7 +1653,7 @@ int SrsConfig::parse_buffer(SrsConfigBuffer* buffer)
return
ret
;
}
return
check_config
()
;
return
ret
;
}
string
SrsConfig
::
cwd
()
...
...
trunk/src/app/srs_app_config.hpp
查看文件 @
20ebf68
...
...
@@ -340,6 +340,11 @@ private:
* parse the config file, which is specified by cli.
*/
virtual
int
parse_file
(
const
char
*
filename
);
public
:
/**
* check the parsed config.
*/
virtual
int
check_config
();
protected
:
/**
* parse config from the buffer.
...
...
@@ -347,11 +352,6 @@ protected:
* @remark, use protected for the utest to override with mock.
*/
virtual
int
parse_buffer
(
_srs_internal
::
SrsConfigBuffer
*
buffer
);
private
:
/**
* check the parsed config.
*/
virtual
int
check_config
();
// global env
public:
/**
...
...
trunk/src/app/srs_app_pithy_print.cpp
查看文件 @
20ebf68
...
...
@@ -38,7 +38,7 @@ SrsStageInfo::SrsStageInfo(int _stage_id)
{
stage_id
=
_stage_id
;
nb_clients
=
0
;
age
=
printed_age
=
0
;
age
=
0
;
update_print_time
();
...
...
trunk/src/app/srs_app_pithy_print.hpp
查看文件 @
20ebf68
...
...
@@ -40,7 +40,6 @@ public:
int
nb_clients
;
public
:
int64_t
age
;
int64_t
printed_age
;
public
:
SrsStageInfo
(
int
_stage_id
);
virtual
~
SrsStageInfo
();
...
...
trunk/src/core/srs_core.hpp
查看文件 @
20ebf68
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
#define VERSION_REVISION "21
5
"
#define VERSION_REVISION "21
6
"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
...
...
trunk/src/main/srs_main_server.cpp
查看文件 @
20ebf68
...
...
@@ -170,6 +170,11 @@ int main(int argc, char** argv)
return
ret
;
}
// we check the config when the log initialized.
if
((
ret
=
_srs_config
->
check_config
())
!=
ERROR_SUCCESS
)
{
return
ret
;
}
srs_trace
(
"srs(simple-rtmp-server) "
RTMP_SIG_SRS_VERSION
);
srs_trace
(
"license: "
RTMP_SIG_SRS_LICENSE
);
srs_trace
(
"authors: "
RTMP_SIG_SRS_PRIMARY_AUTHROS
);
...
...
请
注册
或
登录
后发表评论