mirror of
https://github.com/arut/nginx-rtmp-module.git
synced 2025-08-06 15:00:18 +08:00
added cutting off stream name args & removing trailing backslash from appname; thanks to spuzirev & semihalev
This commit is contained in:
@ -61,6 +61,8 @@ static ngx_int_t
|
||||
ngx_rtmp_cmd_connect_init(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
||||
ngx_chain_t *in)
|
||||
{
|
||||
size_t len;
|
||||
|
||||
static ngx_rtmp_connect_t v;
|
||||
|
||||
static ngx_rtmp_amf_elt_t in_cmd[] = {
|
||||
@ -112,6 +114,11 @@ ngx_rtmp_cmd_connect_init(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
len = ngx_strlen(v.app);
|
||||
if (len && v.app[len - 1] == '/') {
|
||||
v.app[len - 1] = 0;
|
||||
}
|
||||
|
||||
return ngx_rtmp_connect
|
||||
? ngx_rtmp_connect(s, &v)
|
||||
: NGX_OK;
|
||||
@ -363,6 +370,18 @@ ngx_rtmp_cmd_delete_stream(ngx_rtmp_session_t *s, ngx_rtmp_delete_stream_t *v)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ngx_rtmp_cmd_cutoff_args(u_char *s)
|
||||
{
|
||||
u_char *p;
|
||||
|
||||
p = (u_char *)ngx_strchr(s, '?');
|
||||
if (p) {
|
||||
*p = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static ngx_int_t
|
||||
ngx_rtmp_cmd_publish_init(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
||||
ngx_chain_t *in)
|
||||
@ -398,6 +417,8 @@ ngx_rtmp_cmd_publish_init(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
ngx_rtmp_cmd_cutoff_args(v.name);
|
||||
|
||||
return ngx_rtmp_publish
|
||||
? ngx_rtmp_publish(s, &v)
|
||||
: NGX_OK;
|
||||
@ -605,6 +626,8 @@ ngx_rtmp_cmd_play_init(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
ngx_rtmp_cmd_cutoff_args(v.name);
|
||||
|
||||
return ngx_rtmp_play
|
||||
? ngx_rtmp_play(s, &v)
|
||||
: NGX_OK;
|
||||
|
Reference in New Issue
Block a user