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
8 years ago
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ac7ee10b6041c0f13e8ff6fc32233d6dd2804375
ac7ee10b
1 parent
f15fb277
fix #751,#756, refine code
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
5 行增加
和
19 行删除
trunk/src/app/srs_app_http_api.cpp
trunk/src/app/srs_app_http_api.cpp
查看文件 @
ac7ee10
...
...
@@ -791,24 +791,6 @@ int SrsGoApiClients::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
// e.g. /api/v1/clients/100 pattern= /api/v1/clients/, client_id=100
int
cid
=
r
->
parse_rest_id
(
entry
->
pattern
);
std
::
string
start
=
r
->
query_get
(
"start"
);
std
::
string
count
=
r
->
query_get
(
"count"
);
int
cst
=
0
;
int
cct
=
10
;
if
(
!
start
.
empty
()){
cst
=
atoi
(
start
.
c_str
());
}
if
(
!
count
.
empty
()){
cct
=
atoi
(
count
.
c_str
());
}
if
(
cst
<
0
){
cst
=
0
;
}
if
(
cct
<=
0
){
cct
=
10
;
}
SrsStatisticClient
*
client
=
NULL
;
if
(
cid
>=
0
&&
(
client
=
stat
->
find_client
(
cid
))
==
NULL
)
{
ret
=
ERROR_RTMP_CLIENT_NOT_FOUND
;
...
...
@@ -827,7 +809,11 @@ int SrsGoApiClients::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
SrsJsonArray
*
data
=
SrsJsonAny
::
array
();
obj
->
set
(
"clients"
,
data
);
if
((
ret
=
stat
->
dumps_clients
(
data
,
cst
,
cct
))
!=
ERROR_SUCCESS
)
{
std
::
string
rstart
=
r
->
query_get
(
"start"
);
std
::
string
rcount
=
r
->
query_get
(
"count"
);
int
start
=
srs_max
(
0
,
atoi
(
rstart
.
c_str
()));
int
count
=
srs_max
(
10
,
atoi
(
rcount
.
c_str
()));
if
((
ret
=
stat
->
dumps_clients
(
data
,
start
,
count
))
!=
ERROR_SUCCESS
)
{
return
srs_api_response_code
(
w
,
r
,
ret
);
}
}
else
{
...
...
请
注册
或
登录
后发表评论