Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-dryabzhinsky committed Jul 5, 2015
2 parents 3207278 + 2a68430 commit 46c0fe6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions ngx_rtmp_notify_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ ngx_rtmp_notify_publish_create(ngx_rtmp_session_t *s, void *arg,

b = ngx_create_temp_buf(pool,
sizeof("&call=publish") +
sizeof("&app=") + s->app.len * 3 +
sizeof("&name=") + name_len * 3 +
sizeof("&type=") + type_len * 3 +
1 + args_len);
Expand All @@ -550,6 +551,10 @@ ngx_rtmp_notify_publish_create(ngx_rtmp_session_t *s, void *arg,
b->last = ngx_cpymem(b->last, (u_char*) "&call=publish",
sizeof("&call=publish") - 1);

b->last = ngx_cpymem(b->last, (u_char*) "&app=", sizeof("&app=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, s->app.data, s->app.len,
NGX_ESCAPE_ARGS);

b->last = ngx_cpymem(b->last, (u_char*) "&name=", sizeof("&name=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, v->name, name_len,
NGX_ESCAPE_ARGS);
Expand Down Expand Up @@ -587,6 +592,7 @@ ngx_rtmp_notify_play_create(ngx_rtmp_session_t *s, void *arg,

b = ngx_create_temp_buf(pool,
sizeof("&call=play") +
sizeof("&app=") + s->app.len * 3 +
sizeof("&name=") + name_len * 3 +
sizeof("&start=&duration=&reset=") +
NGX_INT32_LEN * 3 + 1 + args_len);
Expand All @@ -600,6 +606,10 @@ ngx_rtmp_notify_play_create(ngx_rtmp_session_t *s, void *arg,
b->last = ngx_cpymem(b->last, (u_char*) "&call=play",
sizeof("&call=play") - 1);

b->last = ngx_cpymem(b->last, (u_char*) "&app=", sizeof("&app=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, s->app.data, s->app.len,
NGX_ESCAPE_ARGS);

b->last = ngx_cpymem(b->last, (u_char*) "&name=", sizeof("&name=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, v->name, name_len,
NGX_ESCAPE_ARGS);
Expand Down Expand Up @@ -642,6 +652,7 @@ ngx_rtmp_notify_done_create(ngx_rtmp_session_t *s, void *arg,

b = ngx_create_temp_buf(pool,
sizeof("&call=") + cbname_len +
sizeof("&app=") + s->app.len * 3 +
sizeof("&name=") + name_len * 3 +
1 + args_len);
if (b == NULL) {
Expand All @@ -654,6 +665,10 @@ ngx_rtmp_notify_done_create(ngx_rtmp_session_t *s, void *arg,
b->last = ngx_cpymem(b->last, (u_char*) "&call=", sizeof("&call=") - 1);
b->last = ngx_cpymem(b->last, ds->cbname, cbname_len);

b->last = ngx_cpymem(b->last, (u_char*) "&app=", sizeof("&app=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, s->app.data, s->app.len,
NGX_ESCAPE_ARGS);

if (name_len) {
b->last = ngx_cpymem(b->last, (u_char*) "&name=", sizeof("&name=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, ctx->name, name_len,
Expand Down Expand Up @@ -701,6 +716,7 @@ ngx_rtmp_notify_update_create(ngx_rtmp_session_t *s, void *arg,
sizeof("&call=update") + sfx.len +
sizeof("&time=") + NGX_TIME_T_LEN +
sizeof("&timestamp=") + NGX_INT32_LEN +
sizeof("&app=") + s->app.len * 3 +
sizeof("&name=") + name_len * 3 +
1 + args_len);
if (b == NULL) {
Expand All @@ -722,6 +738,10 @@ ngx_rtmp_notify_update_create(ngx_rtmp_session_t *s, void *arg,
sizeof("&timestamp=") - 1);
b->last = ngx_sprintf(b->last, "%D", s->current_time);

b->last = ngx_cpymem(b->last, (u_char*) "&app=", sizeof("&app=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, s->app.data, s->app.len,
NGX_ESCAPE_ARGS);

if (name_len) {
b->last = ngx_cpymem(b->last, (u_char*) "&name=", sizeof("&name=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, ctx->name, name_len,
Expand Down Expand Up @@ -760,6 +780,7 @@ ngx_rtmp_notify_record_done_create(ngx_rtmp_session_t *s, void *arg,

b = ngx_create_temp_buf(pool,
sizeof("&call=record_done") +
sizeof("&app=") + s->app.len * 3 +
sizeof("&recorder=") + v->recorder.len +
sizeof("&name=") + name_len * 3 +
sizeof("&path=") + v->path.len * 3 +
Expand All @@ -774,6 +795,10 @@ ngx_rtmp_notify_record_done_create(ngx_rtmp_session_t *s, void *arg,
b->last = ngx_cpymem(b->last, (u_char*) "&call=record_done",
sizeof("&call=record_done") - 1);

b->last = ngx_cpymem(b->last, (u_char*) "&app=", sizeof("&app=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, s->app.data, s->app.len,
NGX_ESCAPE_ARGS);

b->last = ngx_cpymem(b->last, (u_char *) "&recorder=",
sizeof("&recorder=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, v->recorder.data,
Expand Down

0 comments on commit 46c0fe6

Please sign in to comment.