Skip to content

Commit 1840ba1

Browse files
committed
[fix] fix on_connect command bug.
1 parent 2b962b7 commit 1840ba1

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

ngx_http_flv_live_module.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -915,12 +915,6 @@ ngx_http_flv_live_request(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
915915

916916
ngx_http_request_t *r;
917917
ngx_http_flv_live_ctx_t *ctx;
918-
ngx_rtmp_notify_srv_conf_t *nscf;
919-
920-
nscf = ngx_rtmp_get_module_srv_conf(s, ngx_rtmp_notify_module);
921-
if (nscf && nscf->url[NGX_RTMP_NOTIFY_CONNECT]) {
922-
s->wait_notify_connect = 1;
923-
}
924918

925919
r = s->data;
926920
ctx = ngx_http_get_module_ctx(r, ngx_http_flv_live_module);
@@ -1805,8 +1799,9 @@ ngx_int_t
18051799
ngx_http_flv_live_connect_init(ngx_rtmp_session_t *s, ngx_str_t *app,
18061800
ngx_str_t *stream)
18071801
{
1808-
ngx_rtmp_connect_t v;
1809-
ngx_http_request_t *r;
1802+
ngx_rtmp_connect_t v;
1803+
ngx_http_request_t *r;
1804+
ngx_rtmp_notify_srv_conf_t *nscf;
18101805

18111806
r = s->data;
18121807

@@ -1838,6 +1833,11 @@ ngx_http_flv_live_connect_init(ngx_rtmp_session_t *s, ngx_str_t *app,
18381833
return NGX_ERROR;
18391834
}
18401835

1836+
nscf = ngx_rtmp_get_module_srv_conf(s, ngx_rtmp_notify_module);
1837+
if (nscf && nscf->url[NGX_RTMP_NOTIFY_CONNECT]) {
1838+
s->wait_notify_connect = 1;
1839+
}
1840+
18411841
s->stream.len = stream->len;
18421842
s->stream.data = ngx_pstrdup(s->connection->pool, stream);
18431843

ngx_rtmp_cmd_module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,15 @@ ngx_rtmp_cmd_connect_init(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
202202
return NGX_ERROR;
203203
}
204204

205+
ngx_rtmp_cmd_fill_args(v.app, v.args);
206+
205207
len = ngx_strlen(v.app);
206208
if (len > 10 && !ngx_memcmp(v.app + len - 10, "/_definst_", 10)) {
207209
v.app[len - 10] = 0;
208210
} else if (len && v.app[len - 1] == '/') {
209211
v.app[len - 1] = 0;
210212
}
211213

212-
ngx_rtmp_cmd_fill_args(v.app, v.args);
213-
214214
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
215215
"connect: app='%s' args='%s' flashver='%s' swf_url='%s' "
216216
"tc_url='%s' page_url='%s' acodecs=%uD vcodecs=%uD "

0 commit comments

Comments
 (0)