mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-05-20 09:51:08 +02:00
implemented proper initializers for exec_static and pull static
This commit is contained in:
parent
709b173bdc
commit
3fc1598db9
|
@ -29,6 +29,9 @@ static char * ngx_rtmp_merge_applications(ngx_conf_t *cf,
|
||||||
ngx_uint_t ctx_index);
|
ngx_uint_t ctx_index);
|
||||||
|
|
||||||
|
|
||||||
|
ngx_thread_volatile ngx_event_t *ngx_rtmp_init_queue;
|
||||||
|
|
||||||
|
|
||||||
ngx_uint_t ngx_rtmp_max_module;
|
ngx_uint_t ngx_rtmp_max_module;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -576,7 +576,7 @@ extern ngx_rtmp_bandwidth_t ngx_rtmp_bw_in;
|
||||||
|
|
||||||
|
|
||||||
extern ngx_uint_t ngx_rtmp_naccepted;
|
extern ngx_uint_t ngx_rtmp_naccepted;
|
||||||
|
extern ngx_thread_volatile ngx_event_t *ngx_rtmp_init_queue;
|
||||||
|
|
||||||
extern ngx_uint_t ngx_rtmp_max_module;
|
extern ngx_uint_t ngx_rtmp_max_module;
|
||||||
extern ngx_module_t ngx_rtmp_core_module;
|
extern ngx_module_t ngx_rtmp_core_module;
|
||||||
|
|
|
@ -335,7 +335,7 @@ ngx_rtmp_exec_init_process(ngx_cycle_t *cycle)
|
||||||
e->respawn_evt.data = e;
|
e->respawn_evt.data = e;
|
||||||
e->respawn_evt.log = e->log;
|
e->respawn_evt.log = e->log;
|
||||||
e->respawn_evt.handler = ngx_rtmp_exec_respawn;
|
e->respawn_evt.handler = ngx_rtmp_exec_respawn;
|
||||||
ngx_post_event((&e->respawn_evt), &ngx_posted_events);
|
ngx_post_event((&e->respawn_evt), &ngx_rtmp_init_queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
|
|
|
@ -1623,7 +1623,7 @@ ngx_rtmp_relay_init_process(ngx_cycle_t *cycle)
|
||||||
rs->cctx = *lst->ctx;
|
rs->cctx = *lst->ctx;
|
||||||
rs->cctx.app_conf = cacf->app_conf;
|
rs->cctx.app_conf = cacf->app_conf;
|
||||||
|
|
||||||
ngx_post_event(event, &ngx_posted_events);
|
ngx_post_event(event, &ngx_rtmp_init_queue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "ngx_rtmp_codec_module.h"
|
#include "ngx_rtmp_codec_module.h"
|
||||||
|
|
||||||
|
|
||||||
|
static ngx_int_t ngx_rtmp_stat_init_process(ngx_cycle_t *cycle);
|
||||||
static char *ngx_rtmp_stat(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
|
static char *ngx_rtmp_stat(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
|
||||||
static ngx_int_t ngx_rtmp_stat_postconfiguration(ngx_conf_t *cf);
|
static ngx_int_t ngx_rtmp_stat_postconfiguration(ngx_conf_t *cf);
|
||||||
static void * ngx_rtmp_stat_create_loc_conf(ngx_conf_t *cf);
|
static void * ngx_rtmp_stat_create_loc_conf(ngx_conf_t *cf);
|
||||||
|
@ -88,7 +89,7 @@ ngx_module_t ngx_rtmp_stat_module = {
|
||||||
NGX_HTTP_MODULE, /* module type */
|
NGX_HTTP_MODULE, /* module type */
|
||||||
NULL, /* init master */
|
NULL, /* init master */
|
||||||
NULL, /* init module */
|
NULL, /* init module */
|
||||||
NULL, /* init process */
|
ngx_rtmp_stat_init_process, /* init process */
|
||||||
NULL, /* init thread */
|
NULL, /* init thread */
|
||||||
NULL, /* exit thread */
|
NULL, /* exit thread */
|
||||||
NULL, /* exit process */
|
NULL, /* exit process */
|
||||||
|
@ -100,6 +101,21 @@ ngx_module_t ngx_rtmp_stat_module = {
|
||||||
#define NGX_RTMP_STAT_BUFSIZE 256
|
#define NGX_RTMP_STAT_BUFSIZE 256
|
||||||
|
|
||||||
|
|
||||||
|
static ngx_int_t
|
||||||
|
ngx_rtmp_stat_init_process(ngx_cycle_t *cycle)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* HTTP process initializer is called
|
||||||
|
* after event module initializer
|
||||||
|
* so we can run posted events here
|
||||||
|
*/
|
||||||
|
|
||||||
|
ngx_event_process_posted(cycle, &ngx_rtmp_init_queue);
|
||||||
|
|
||||||
|
return NGX_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ngx_escape_html does not escape characters out of ASCII range
|
/* ngx_escape_html does not escape characters out of ASCII range
|
||||||
* which are bad for xslt */
|
* which are bad for xslt */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue