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
2015-11-16 18:10:06 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
18eb8c81b34caea34e73a127e0423d3a8fbed617
18eb8c81
2 parents
51ed4b1e
2310b2da
merge from srs2
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
23 行增加
和
3 行删除
README.md
trunk/scripts/_log.sh
trunk/src/app/srs_app_server.cpp
README.md
查看文件 @
18eb8c8
...
...
@@ -1286,6 +1286,7 @@ Winlin
[
bug #512
]:
https://github.com/ossrs/srs/issues/512
[
bug #515
]:
https://github.com/ossrs/srs/issues/515
[
bug #511
]:
https://github.com/ossrs/srs/issues/511
[
bug #518
]:
https://github.com/ossrs/srs/issues/518
[
bug #xxxxxxxxxx
]:
https://github.com/ossrs/srs/issues/xxxxxxxxxx
[
exo #828
]:
https://github.com/google/ExoPlayer/pull/828
...
...
trunk/scripts/_log.sh
查看文件 @
18eb8c8
...
...
@@ -8,7 +8,7 @@ RED="\\033[31m"
GREEN
=
"
\\
033[32m"
YELLOW
=
"
\\
033[33m"
BLACK
=
"
\\
033[0m"
POS
=
"
\\
033[
103
G"
POS
=
"
\\
033[
94
G"
# if need to log to file, change the log path.
if
[[
!
$log
]]
;
then
...
...
trunk/src/app/srs_app_server.cpp
查看文件 @
18eb8c8
...
...
@@ -1253,10 +1253,10 @@ int SrsServer::accept_client(SrsListenerType type, st_netfd_t client_stfd)
{
int
ret
=
ERROR_SUCCESS
;
int
fd
=
st_netfd_fileno
(
client_stfd
);
int
max_connections
=
_srs_config
->
get_max_connections
();
if
((
int
)
conns
.
size
()
>=
max_connections
)
{
int
fd
=
st_netfd_fileno
(
client_stfd
);
srs_error
(
"exceed the max connections, drop client: "
"clients=%d, max=%d, fd=%d"
,
(
int
)
conns
.
size
(),
max_connections
,
fd
);
...
...
@@ -1265,6 +1265,25 @@ int SrsServer::accept_client(SrsListenerType type, st_netfd_t client_stfd)
return
ret
;
}
// avoid fd leak when fork.
// @see https://github.com/ossrs/srs/issues/518
if
(
true
)
{
int
val
;
if
((
val
=
fcntl
(
fd
,
F_GETFD
,
0
))
<
0
)
{
ret
=
ERROR_SYSTEM_PID_GET_FILE_INFO
;
srs_error
(
"fnctl F_GETFD error! fd=%d. ret=%#x"
,
fd
,
ret
);
srs_close_stfd
(
client_stfd
);
return
ret
;
}
val
|=
FD_CLOEXEC
;
if
(
fcntl
(
fd
,
F_SETFD
,
val
)
<
0
)
{
ret
=
ERROR_SYSTEM_PID_SET_FILE_INFO
;
srs_error
(
"fcntl F_SETFD error! fd=%d ret=%#x"
,
fd
,
ret
);
srs_close_stfd
(
client_stfd
);
return
ret
;
}
}
SrsConnection
*
conn
=
NULL
;
if
(
type
==
SrsListenerRtmpStream
)
{
conn
=
new
SrsRtmpConn
(
this
,
kafka
,
client_stfd
);
...
...
请
注册
或
登录
后发表评论