mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-05-20 01:51:07 +02:00
added stat before socket connect to fix auto_push connection error
This commit is contained in:
parent
dd75b749da
commit
97a5a860e2
|
@ -311,6 +311,7 @@ ngx_rtmp_auto_push_reconnect(ngx_event_t *ev)
|
||||||
ngx_pid_t pid;
|
ngx_pid_t pid;
|
||||||
ngx_int_t npushed;
|
ngx_int_t npushed;
|
||||||
ngx_core_conf_t *ccf;
|
ngx_core_conf_t *ccf;
|
||||||
|
ngx_file_info_t fi;
|
||||||
|
|
||||||
ngx_log_debug0(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
|
ngx_log_debug0(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
|
||||||
"auto_push: reconnect");
|
"auto_push: reconnect");
|
||||||
|
@ -362,6 +363,15 @@ ngx_rtmp_auto_push_reconnect(ngx_event_t *ev)
|
||||||
"unix:%V/" NGX_RTMP_AUTO_PUSH_SOCKNAME ".%i",
|
"unix:%V/" NGX_RTMP_AUTO_PUSH_SOCKNAME ".%i",
|
||||||
&apcf->socket_dir, n);
|
&apcf->socket_dir, n);
|
||||||
*p = 0;
|
*p = 0;
|
||||||
|
|
||||||
|
if (ngx_file_info(path + sizeof("unix:") - 1, &fi) != NGX_OK) {
|
||||||
|
ngx_log_debug5(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
|
||||||
|
"auto_push: " ngx_file_info_n " failed: "
|
||||||
|
"slot=%i pid=%P socket='%s'" "url='%V' name='%s'",
|
||||||
|
n, pid, path, u, ctx->name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
u->data = path;
|
u->data = path;
|
||||||
u->len = p - path;
|
u->len = p - path;
|
||||||
if (ngx_parse_url(s->connection->pool, &at.url) != NGX_OK) {
|
if (ngx_parse_url(s->connection->pool, &at.url) != NGX_OK) {
|
||||||
|
|
Loading…
Reference in a new issue