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
2013-10-18 17:10:24 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
96e1de255cafa112bc3792f868e9f06ef11e3fc2
96e1de25
1 parent
973bea1e
close fd when delete connection object
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
11 行增加
和
2 行删除
trunk/src/core/srs_core_conn.cpp
trunk/src/core/srs_core_server.cpp
trunk/src/core/srs_core_conn.cpp
查看文件 @
96e1de2
...
...
@@ -35,6 +35,10 @@ SrsConnection::SrsConnection(SrsServer* srs_server, st_netfd_t client_stfd)
SrsConnection
::~
SrsConnection
()
{
if
(
stfd
)
{
st_netfd_close
(
stfd
);
stfd
=
NULL
;
}
}
int
SrsConnection
::
start
()
...
...
@@ -59,7 +63,7 @@ void SrsConnection::cycle()
// success.
if
(
ret
==
ERROR_SUCCESS
)
{
Srs
Info
(
"client process normally finished. ret=%d"
,
ret
);
Srs
Trace
(
"client process normally finished. ret=%d"
,
ret
);
}
// client close peer.
...
...
trunk/src/core/srs_core_server.cpp
查看文件 @
96e1de2
...
...
@@ -148,6 +148,8 @@ void SrsServer::remove(SrsConnection* conn)
conns
.
erase
(
it
);
}
SrsInfo
(
"conn removed. conns=%d"
,
(
int
)
conns
.
size
());
// all connections are created by server,
// so we delete it here.
delete
conn
;
...
...
@@ -161,11 +163,13 @@ int SrsServer::accept_client(st_netfd_t client_stfd)
// directly enqueue, the cycle thread will remove the client.
conns
.
push_back
(
conn
);
SrsVerbose
(
"add conn to vector. conns=%d"
,
(
int
)
conns
.
size
());
// cycle will start process thread and when finished remove the client.
if
((
ret
=
conn
->
start
())
!=
ERROR_SUCCESS
)
{
return
ret
;
}
SrsVerbose
(
"conn start finished. ret=%d"
,
ret
);
return
ret
;
}
...
...
@@ -182,13 +186,14 @@ void SrsServer::listen_cycle()
SrsWarn
(
"ignore accept thread stoppped for accept client error"
);
continue
;
}
SrsVerbose
(
"get a client. fd=%d"
,
st_netfd_fileno
(
client_stfd
));
if
((
ret
=
accept_client
(
client_stfd
))
!=
ERROR_SUCCESS
)
{
SrsWarn
(
"accept client error. ret=%d"
,
ret
);
continue
;
}
SrsVerbose
(
"accept client finished.
ret=%d"
,
ret
);
SrsVerbose
(
"accept client finished.
conns=%d, ret=%d"
,
(
int
)
conns
.
size
()
,
ret
);
}
}
...
...
请
注册
或
登录
后发表评论