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
Nimrod A. Abing (on kohima)
2015-03-09 12:45:26 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
winlin
2015-03-16 15:39:49 +0800
Commit
a95bd7d30e067ac0a1650ca3e75d696060e573bc
a95bd7d3
1 parent
bc931474
Modified on_close webhook.
Pass the send_bytes and recv_bytes count to the web hook.
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
5 行增加
和
3 行删除
trunk/src/app/srs_app_http_hooks.cpp
trunk/src/app/srs_app_http_hooks.hpp
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/app/srs_app_http_hooks.cpp
查看文件 @
a95bd7d
...
...
@@ -82,7 +82,7 @@ int SrsHttpHooks::on_connect(string url, int client_id, string ip, SrsRequest* r
return
ret
;
}
void
SrsHttpHooks
::
on_close
(
string
url
,
int
client_id
,
string
ip
,
SrsRequest
*
req
)
void
SrsHttpHooks
::
on_close
(
string
url
,
int
client_id
,
string
ip
,
SrsRequest
*
req
,
int64_t
send_bytes
,
int64_t
recv_bytes
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -92,6 +92,8 @@ void SrsHttpHooks::on_close(string url, int client_id, string ip, SrsRequest* re
<<
__SRS_JFIELD_ORG
(
"client_id"
,
client_id
)
<<
__SRS_JFIELD_CONT
<<
__SRS_JFIELD_STR
(
"ip"
,
ip
)
<<
__SRS_JFIELD_CONT
<<
__SRS_JFIELD_STR
(
"vhost"
,
req
->
vhost
)
<<
__SRS_JFIELD_CONT
<<
__SRS_JFIELD_ORG
(
"send_bytes"
,
send_bytes
)
<<
__SRS_JFIELD_CONT
<<
__SRS_JFIELD_ORG
(
"recv_bytes"
,
recv_bytes
)
<<
__SRS_JFIELD_CONT
<<
__SRS_JFIELD_STR
(
"app"
,
req
->
app
)
<<
__SRS_JOBJECT_END
;
...
...
trunk/src/app/srs_app_http_hooks.hpp
查看文件 @
a95bd7d
...
...
@@ -66,7 +66,7 @@ public:
* @param url the api server url, to process the event.
* ignore if empty.
*/
static
void
on_close
(
std
::
string
url
,
int
client_id
,
std
::
string
ip
,
SrsRequest
*
req
);
static
void
on_close
(
std
::
string
url
,
int
client_id
,
std
::
string
ip
,
SrsRequest
*
req
,
int64_t
send_bytes
,
int64_t
recv_bytes
);
/**
* on_publish hook, when client(encoder) start to publish stream
* @param client_id the id of client on server.
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
a95bd7d
...
...
@@ -1294,7 +1294,7 @@ void SrsRtmpConn::http_hooks_on_close()
int
connection_id
=
_srs_context
->
get_id
();
for
(
int
i
=
0
;
i
<
(
int
)
on_close
->
args
.
size
();
i
++
)
{
std
::
string
url
=
on_close
->
args
.
at
(
i
);
SrsHttpHooks
::
on_close
(
url
,
connection_id
,
ip
,
req
);
SrsHttpHooks
::
on_close
(
url
,
connection_id
,
ip
,
req
,
skt
->
get_send_bytes
(),
skt
->
get_recv_bytes
()
);
}
}
#endif
...
...
请
注册
或
登录
后发表评论