mirror of
https://github.com/arut/nginx-rtmp-module.git
synced 2025-08-06 15:00:18 +08:00
fixed creating relay tcUrl
This commit is contained in:
@ -741,8 +741,8 @@ ngx_rtmp_relay_send_connect(ngx_rtmp_session_t *s)
|
|||||||
ngx_rtmp_core_srv_conf_t *cscf;
|
ngx_rtmp_core_srv_conf_t *cscf;
|
||||||
ngx_rtmp_relay_ctx_t *ctx;
|
ngx_rtmp_relay_ctx_t *ctx;
|
||||||
ngx_rtmp_header_t h;
|
ngx_rtmp_header_t h;
|
||||||
size_t len;
|
size_t len, url_len;
|
||||||
u_char *p;
|
u_char *p, *url_end;
|
||||||
|
|
||||||
|
|
||||||
cacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_core_module);
|
cacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_core_module);
|
||||||
@ -774,7 +774,14 @@ ngx_rtmp_relay_send_connect(ngx_rtmp_session_t *s)
|
|||||||
}
|
}
|
||||||
out_cmd[1].data = p;
|
out_cmd[1].data = p;
|
||||||
p = ngx_cpymem(p, "rtmp://", sizeof("rtmp://") - 1);
|
p = ngx_cpymem(p, "rtmp://", sizeof("rtmp://") - 1);
|
||||||
p = ngx_cpymem(p, ctx->url.data, ctx->url.len);
|
|
||||||
|
url_len = ctx->url.len;
|
||||||
|
url_end = ngx_strlchr(ctx->url.data, ctx->url.data + ctx->url.len, '/');
|
||||||
|
if (url_end) {
|
||||||
|
url_len = (size_t) (url_end - ctx->url.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
p = ngx_cpymem(p, ctx->url.data, url_len);
|
||||||
*p++ = '/';
|
*p++ = '/';
|
||||||
p = ngx_cpymem(p, ctx->app.data, ctx->app.len);
|
p = ngx_cpymem(p, ctx->app.data, ctx->app.len);
|
||||||
out_cmd[1].len = p - (u_char *)out_cmd[1].data;
|
out_cmd[1].len = p - (u_char *)out_cmd[1].data;
|
||||||
|
Reference in New Issue
Block a user