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 17:59:39 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
803c899a9b7a2b529a342725318e9586da4d0112
803c899a
2 parents
c77cefb6
eb4ca9ff
Merge pull request #530 from YueHonghui/2.0release
fix bug of fd leek in srs_app_server
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
15 行增加
和
3 行删除
trunk/src/app/srs_app_server.cpp
trunk/src/app/srs_app_server.cpp
查看文件 @
803c899
...
...
@@ -1223,10 +1223,9 @@ void SrsServer::resample_kbps()
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
);
...
...
@@ -1235,7 +1234,20 @@ int SrsServer::accept_client(SrsListenerType type, st_netfd_t client_stfd)
return
ret
;
}
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
,
client_stfd
);
...
...
请
注册
或
登录
后发表评论