mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-05-17 00:51:09 +02:00
Merge pull request #331 from sergey-dryabzhinsky/issue-317-fix-double-ampersand-in-event-request
Issue 317 fix double ampersand in event request
This commit is contained in:
commit
d4d762e917
|
@ -586,11 +586,13 @@ ngx_rtmp_netcall_http_format_session(ngx_rtmp_session_t *s, ngx_pool_t *pool)
|
||||||
* So not override them with empty values
|
* So not override them with empty values
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bsize = sizeof("&addr=") - 1 + addr_text->len * 3 +
|
bsize = sizeof("addr=") - 1 + addr_text->len * 3 +
|
||||||
sizeof("&clientid=") - 1 + NGX_INT_T_LEN;
|
sizeof("&clientid=") - 1 + NGX_INT_T_LEN;
|
||||||
|
|
||||||
|
// Indicator of additional vars from session
|
||||||
|
// Event `connect` don't have them, for example
|
||||||
if (s->app.len) {
|
if (s->app.len) {
|
||||||
bsize += sizeof("app=") - 1 + s->app.len * 3;
|
bsize += sizeof("&app=") - 1 + s->app.len * 3;
|
||||||
}
|
}
|
||||||
if (s->flashver.len) {
|
if (s->flashver.len) {
|
||||||
bsize += sizeof("&flashver=") - 1 + s->flashver.len * 3;
|
bsize += sizeof("&flashver=") - 1 + s->flashver.len * 3;
|
||||||
|
@ -613,8 +615,16 @@ ngx_rtmp_netcall_http_format_session(ngx_rtmp_session_t *s, ngx_pool_t *pool)
|
||||||
cl->buf = b;
|
cl->buf = b;
|
||||||
cl->next = NULL;
|
cl->next = NULL;
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
if (s->app.len) {
|
if (s->app.len) {
|
||||||
b->last = ngx_cpymem(b->last, (u_char*) "app=", sizeof("app=") - 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,
|
b->last = (u_char*) ngx_escape_uri(b->last, s->app.data, s->app.len,
|
||||||
NGX_ESCAPE_ARGS);
|
NGX_ESCAPE_ARGS);
|
||||||
}
|
}
|
||||||
|
@ -643,14 +653,6 @@ ngx_rtmp_netcall_http_format_session(ngx_rtmp_session_t *s, ngx_pool_t *pool)
|
||||||
s->page_url.len, NGX_ESCAPE_ARGS);
|
s->page_url.len, NGX_ESCAPE_ARGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
return cl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -833,7 +833,10 @@ ngx_rtmp_stat_handler(ngx_http_request_t *r)
|
||||||
#ifdef NGX_COMPILER
|
#ifdef NGX_COMPILER
|
||||||
NGX_RTMP_STAT_L("<compiler>" NGX_COMPILER "</compiler>\r\n");
|
NGX_RTMP_STAT_L("<compiler>" NGX_COMPILER "</compiler>\r\n");
|
||||||
#endif
|
#endif
|
||||||
|
/* This may prevent reproducible builds. If you need that info - pass `-DNGX_BUILD_DATEITIME=1` to CFLAGS */
|
||||||
|
#ifdef NGX_BUILD_DATEITIME
|
||||||
NGX_RTMP_STAT_L("<built>" __DATE__ " " __TIME__ "</built>\r\n");
|
NGX_RTMP_STAT_L("<built>" __DATE__ " " __TIME__ "</built>\r\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
NGX_RTMP_STAT_L("<pid>");
|
NGX_RTMP_STAT_L("<pid>");
|
||||||
NGX_RTMP_STAT(nbuf, ngx_snprintf(nbuf, sizeof(nbuf),
|
NGX_RTMP_STAT(nbuf, ngx_snprintf(nbuf, sizeof(nbuf),
|
||||||
|
|
Loading…
Reference in a new issue