fixed creating relay tcUrl

This commit is contained in:
Roman Arutyunyan 2012-12-17 21:38:13 +04:00
parent 0a4296b9a2
commit 96b0fddbb1

View file

@ -741,8 +741,8 @@ ngx_rtmp_relay_send_connect(ngx_rtmp_session_t *s)
ngx_rtmp_core_srv_conf_t *cscf;
ngx_rtmp_relay_ctx_t *ctx;
ngx_rtmp_header_t h;
size_t len;
u_char *p;
size_t len, url_len;
u_char *p, *url_end;
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;
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 = ngx_cpymem(p, ctx->app.data, ctx->app.len);
out_cmd[1].len = p - (u_char *)out_cmd[1].data;