mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
STAT: Add server_id into http_hooks (#2692) v4.0.185
This commit is contained in:
parent
5783c4420f
commit
ced518ea92
3 changed files with 5 additions and 1 deletions
|
@ -8,6 +8,7 @@ The changelog for SRS.
|
||||||
|
|
||||||
## SRS 4.0 Changelog
|
## SRS 4.0 Changelog
|
||||||
|
|
||||||
|
* v4.0, 2021-10-25, Merge [#2692](https://github.com/ossrs/srs/pull/2692): API: Add server_id into http_hooks. v4.0.185
|
||||||
* v4.0, 2021-10-22, Merge [#2687](https://github.com/ossrs/srs/pull/2687): API: Always stat client event if auth fail. v4.0.183
|
* v4.0, 2021-10-22, Merge [#2687](https://github.com/ossrs/srs/pull/2687): API: Always stat client event if auth fail. v4.0.183
|
||||||
* v4.0, 2021-10-20, Merge [#1758](https://github.com/ossrs/srs/pull/1758): JSON: Support escape special chars. v4.0.182
|
* v4.0, 2021-10-20, Merge [#1758](https://github.com/ossrs/srs/pull/1758): JSON: Support escape special chars. v4.0.182
|
||||||
* v4.0, 2021-10-19, Merge [#1754](https://github.com/ossrs/srs/pull/1754): RTMP: If port is explicity set to 0, use default 1935. v4.0.181
|
* v4.0, 2021-10-19, Merge [#1754](https://github.com/ossrs/srs/pull/1754): RTMP: If port is explicity set to 0, use default 1935. v4.0.181
|
||||||
|
|
|
@ -45,10 +45,13 @@ srs_error_t SrsHttpHooks::on_connect(string url, SrsRequest* req)
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
|
||||||
SrsContextId cid = _srs_context->get_id();
|
SrsContextId cid = _srs_context->get_id();
|
||||||
|
|
||||||
|
SrsStatistic* stat = SrsStatistic::instance();
|
||||||
|
|
||||||
SrsJsonObject* obj = SrsJsonAny::object();
|
SrsJsonObject* obj = SrsJsonAny::object();
|
||||||
SrsAutoFree(SrsJsonObject, obj);
|
SrsAutoFree(SrsJsonObject, obj);
|
||||||
|
|
||||||
|
obj->set("server_id", SrsJsonAny::str(stat->server_id().c_str()));
|
||||||
obj->set("action", SrsJsonAny::str("on_connect"));
|
obj->set("action", SrsJsonAny::str("on_connect"));
|
||||||
obj->set("client_id", SrsJsonAny::str(cid.c_str()));
|
obj->set("client_id", SrsJsonAny::str(cid.c_str()));
|
||||||
obj->set("ip", SrsJsonAny::str(req->ip.c_str()));
|
obj->set("ip", SrsJsonAny::str(req->ip.c_str()));
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
#define VERSION_MAJOR 4
|
#define VERSION_MAJOR 4
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 184
|
#define VERSION_REVISION 185
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue