11
11
#include "ngx_rtmp_record_module.h"
12
12
13
13
14
- static ngx_int_t ngx_rtmp_control_postconfiguration (ngx_conf_t * cf );
14
+ static char * ngx_rtmp_control (ngx_conf_t * cf , ngx_command_t * cmd , void * conf );
15
15
static void * ngx_rtmp_control_create_loc_conf (ngx_conf_t * cf );
16
16
static char * ngx_rtmp_control_merge_loc_conf (ngx_conf_t * cf ,
17
17
void * parent , void * child );
@@ -52,7 +52,7 @@ static ngx_command_t ngx_rtmp_control_commands[] = {
52
52
53
53
{ ngx_string ("rtmp_control" ),
54
54
NGX_HTTP_MAIN_CONF |NGX_HTTP_SRV_CONF |NGX_HTTP_LOC_CONF |NGX_CONF_1MORE ,
55
- ngx_conf_set_bitmask_slot ,
55
+ ngx_rtmp_control ,
56
56
NGX_HTTP_LOC_CONF_OFFSET ,
57
57
offsetof(ngx_rtmp_control_loc_conf_t , control ),
58
58
ngx_rtmp_control_masks },
@@ -63,7 +63,7 @@ static ngx_command_t ngx_rtmp_control_commands[] = {
63
63
64
64
static ngx_http_module_t ngx_rtmp_control_module_ctx = {
65
65
NULL , /* preconfiguration */
66
- ngx_rtmp_control_postconfiguration , /* postconfiguration */
66
+ NULL , /* postconfiguration */
67
67
68
68
NULL , /* create main configuration */
69
69
NULL , /* init main configuration */
@@ -511,19 +511,13 @@ ngx_rtmp_control_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
511
511
}
512
512
513
513
514
- static ngx_int_t
515
- ngx_rtmp_control_postconfiguration (ngx_conf_t * cf )
514
+ static char *
515
+ ngx_rtmp_control (ngx_conf_t * cf , ngx_command_t * cmd , void * conf )
516
516
{
517
- ngx_http_handler_pt * h ;
518
- ngx_http_core_main_conf_t * cmcf ;
519
-
520
- cmcf = ngx_http_conf_get_module_main_conf (cf , ngx_http_core_module );
517
+ ngx_http_core_loc_conf_t * clcf ;
521
518
522
- h = ngx_array_push (& cmcf -> phases [NGX_HTTP_CONTENT_PHASE ].handlers );
523
- if (h == NULL ) {
524
- return NGX_ERROR ;
525
- }
526
- * h = ngx_rtmp_control_handler ;
519
+ clcf = ngx_http_conf_get_module_loc_conf (cf , ngx_http_core_module );
520
+ clcf -> handler = ngx_rtmp_control_handler ;
527
521
528
- return NGX_OK ;
529
- }
522
+ return ngx_conf_set_bitmask_slot ( cf , cmd , conf ) ;
523
+ }
0 commit comments