mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-05-20 01:51:07 +02:00
disabled auto-push sockets for non-workers (cache processes); clients still connect to them
This commit is contained in:
parent
b86bc7636e
commit
06f4699399
|
@ -103,6 +103,9 @@ ngx_rtmp_auto_push_init_process(ngx_cycle_t *cycle)
|
||||||
size_t n;
|
size_t n;
|
||||||
ngx_file_info_t fi;
|
ngx_file_info_t fi;
|
||||||
|
|
||||||
|
if (ngx_process != NGX_PROCESS_WORKER) {
|
||||||
|
return NGX_OK;
|
||||||
|
}
|
||||||
|
|
||||||
apcf = (ngx_rtmp_auto_push_conf_t *) ngx_get_conf(cycle->conf_ctx,
|
apcf = (ngx_rtmp_auto_push_conf_t *) ngx_get_conf(cycle->conf_ctx,
|
||||||
ngx_rtmp_auto_push_module);
|
ngx_rtmp_auto_push_module);
|
||||||
|
@ -110,14 +113,12 @@ ngx_rtmp_auto_push_init_process(ngx_cycle_t *cycle)
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
next_publish = ngx_rtmp_publish;
|
next_publish = ngx_rtmp_publish;
|
||||||
ngx_rtmp_publish = ngx_rtmp_auto_push_publish;
|
ngx_rtmp_publish = ngx_rtmp_auto_push_publish;
|
||||||
|
|
||||||
next_delete_stream = ngx_rtmp_delete_stream;
|
next_delete_stream = ngx_rtmp_delete_stream;
|
||||||
ngx_rtmp_delete_stream = ngx_rtmp_auto_push_delete_stream;
|
ngx_rtmp_delete_stream = ngx_rtmp_auto_push_delete_stream;
|
||||||
|
|
||||||
|
|
||||||
reuseaddr = 1;
|
reuseaddr = 1;
|
||||||
s = (ngx_socket_t) -1;
|
s = (ngx_socket_t) -1;
|
||||||
|
|
||||||
|
@ -341,7 +342,7 @@ ngx_rtmp_auto_push_reconnect(ngx_event_t *ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
pid = ngx_processes[n].pid;
|
pid = ngx_processes[n].pid;
|
||||||
if (pid == 0 || pid == -1) {
|
if (pid == 0 || pid == NGX_INVALID_PID) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue