diff --git a/ngx_rtmp_netcall_module.c b/ngx_rtmp_netcall_module.c
index 24c001c..9ffadde 100644
--- a/ngx_rtmp_netcall_module.c
+++ b/ngx_rtmp_netcall_module.c
@@ -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
*/
- bsize = sizeof("&addr=") - 1 + addr_text->len * 3 +
+ bsize = sizeof("addr=") - 1 + addr_text->len * 3 +
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) {
- bsize += sizeof("app=") - 1 + s->app.len * 3;
+ bsize += sizeof("&app=") - 1 + s->app.len * 3;
}
if (s->flashver.len) {
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->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) {
- 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,
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);
}
- 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;
}
diff --git a/ngx_rtmp_stat_module.c b/ngx_rtmp_stat_module.c
index 8d21c8b..265d951 100644
--- a/ngx_rtmp_stat_module.c
+++ b/ngx_rtmp_stat_module.c
@@ -833,7 +833,10 @@ ngx_rtmp_stat_handler(ngx_http_request_t *r)
#ifdef NGX_COMPILER
NGX_RTMP_STAT_L("" NGX_COMPILER "\r\n");
#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("" __DATE__ " " __TIME__ "\r\n");
+#endif
NGX_RTMP_STAT_L("");
NGX_RTMP_STAT(nbuf, ngx_snprintf(nbuf, sizeof(nbuf),