diff --git a/ngx_rtmp.c b/ngx_rtmp.c index e525a93..c83e9e1 100644 --- a/ngx_rtmp.c +++ b/ngx_rtmp.c @@ -29,6 +29,7 @@ static ngx_int_t ngx_rtmp_init_event_handlers(ngx_conf_t *cf, static char * ngx_rtmp_merge_applications(ngx_conf_t *cf, ngx_array_t *applications, void **app_conf, ngx_rtmp_module_t *module, ngx_uint_t ctx_index); +static ngx_int_t ngx_rtmp_init_process(ngx_cycle_t *cycle); #if (nginx_version >= 1007005) @@ -68,7 +69,7 @@ ngx_module_t ngx_rtmp_module = { NGX_CORE_MODULE, /* module type */ NULL, /* init master */ NULL, /* init module */ - NULL, /* init process */ + ngx_rtmp_init_process, /* init process */ NULL, /* init thread */ NULL, /* exit thread */ NULL, /* exit process */ @@ -831,3 +832,13 @@ ngx_rtmp_rmemcpy(void *dst, const void* src, size_t n) return dst; } + + +static ngx_int_t +ngx_rtmp_init_process(ngx_cycle_t *cycle) +{ +#if (nginx_version >= 1007005) + ngx_queue_init(&ngx_rtmp_init_queue); +#endif + return NGX_OK; +} diff --git a/ngx_rtmp_init.c b/ngx_rtmp_init.c index 836935d..97c7e9a 100644 --- a/ngx_rtmp_init.c +++ b/ngx_rtmp_init.c @@ -197,6 +197,10 @@ ngx_rtmp_init_session(ngx_connection_t *c, ngx_rtmp_addr_conf_t *addr_conf) return NULL; } +#if (nginx_version >= 1007005) + ngx_queue_init(&s->posted_dry_events); +#endif + s->epoch = ngx_current_msec; s->timeout = cscf->timeout; s->buflen = cscf->buflen;