added clientid to notifications & control

This commit is contained in:
Roman Arutyunyan 2014-01-16 20:51:33 +04:00
parent 8d9f99b540
commit a8094dfef1
2 changed files with 19 additions and 3 deletions

View file

@ -259,7 +259,7 @@ static const char *
ngx_rtmp_control_walk_session(ngx_http_request_t *r,
ngx_rtmp_live_ctx_t *lctx)
{
ngx_str_t addr, *paddr;
ngx_str_t addr, *paddr, clientid;
ngx_rtmp_session_t *s, **ss;
ngx_rtmp_control_ctx_t *ctx;
@ -280,6 +280,17 @@ ngx_rtmp_control_walk_session(ngx_http_request_t *r,
}
}
if (ngx_http_arg(r, (u_char *) "clientid", sizeof("clientid") - 1,
&clientid)
== NGX_OK)
{
if (s->connection->number !=
(ngx_uint_t) ngx_atoi(clientid.data, clientid.len))
{
return NGX_CONF_OK;
}
}
ctx = ngx_http_get_module_ctx(r, ngx_rtmp_control_module);
switch (ctx->filter) {

View file

@ -585,7 +585,8 @@ ngx_rtmp_netcall_http_format_session(ngx_rtmp_session_t *s, ngx_pool_t *pool)
sizeof("&swfurl=") - 1 + s->swf_url.len * 3 +
sizeof("&tcurl=") - 1 + s->tc_url.len * 3 +
sizeof("&pageurl=") - 1 + s->page_url.len * 3 +
sizeof("&addr=") - 1 + addr_text->len * 3
sizeof("&addr=") - 1 + addr_text->len * 3 +
sizeof("&clientid=") - 1 + NGX_INT_T_LEN
);
if (b == NULL) {
@ -619,10 +620,14 @@ ngx_rtmp_netcall_http_format_session(ngx_rtmp_session_t *s, ngx_pool_t *pool)
b->last = (u_char*) ngx_escape_uri(b->last, s->page_url.data,
s->page_url.len, NGX_ESCAPE_ARGS);
b->last = ngx_cpymem(b->last, (u_char*) "&addr=", sizeof("&addr=") -1);
b->last = ngx_cpymem(b->last, (u_char*) "&addr=", sizeof("&addr=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, addr_text->data,
addr_text->len, NGX_ESCAPE_ARGS);
b->last = ngx_cpymem(b->last, (u_char*) "&clientid=",
sizeof("&clientid=") - 1);
b->last = ngx_sprintf(b->last, "%ui", (ngx_uint_t) s->connection->number);
return cl;
}