Skip to content

Commit 5fa25fa

Browse files
committed
renaming module
1 parent 4616888 commit 5fa25fa

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
ngx_addon_name=ngx_http_allow_method_module
2-
HTTP_MODULES="$HTTP_MODULES ngx_http_allow_method_module"
3-
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_allow_method_module.c"
1+
ngx_addon_name=ngx_http_allow_methods_module
2+
HTTP_MODULES="$HTTP_MODULES ngx_http_allow_methods_module"
3+
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_allow_methods_module.c"

ngx_http_allow_method_module.c

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ typedef struct {
1414
#if (NGX_PCRE)
1515
ngx_regex_t *regex;
1616
#endif
17-
} ngx_http_allow_method_loc_conf_t;
17+
} ngx_http_allow_methods_loc_conf_t;
1818

1919

20-
static ngx_int_t ngx_http_allow_method_handler(ngx_http_request_t *r);
20+
static ngx_int_t ngx_http_allow_methods_handler(ngx_http_request_t *r);
2121

22-
static void *ngx_http_allow_method_create_loc_conf(ngx_conf_t *cf);
23-
static char *ngx_http_allow_method_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child);
24-
static char *ngx_http_allow_method_set_allow_methods(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
25-
static ngx_int_t ngx_http_allow_method_init(ngx_conf_t *cf);
22+
static void *ngx_http_allow_methods_create_loc_conf(ngx_conf_t *cf);
23+
static char *ngx_http_allow_methods_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child);
24+
static char *ngx_http_allow_methods_set_allow_methods(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
25+
static ngx_int_t ngx_http_allow_methods_init(ngx_conf_t *cf);
2626

2727

28-
static ngx_command_t ngx_http_allow_method_commands[] = {
28+
static ngx_command_t ngx_http_allow_methods_commands[] = {
2929

3030
{ ngx_string("allow_methods"),
3131
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_1MORE,
32-
ngx_http_allow_method_set_allow_methods,
32+
ngx_http_allow_methods_set_allow_methods,
3333
NGX_HTTP_LOC_CONF_OFFSET,
3434
0,
3535
NULL },
@@ -38,11 +38,11 @@ static ngx_command_t ngx_http_allow_method_commands[] = {
3838
};
3939

4040
static char *
41-
ngx_http_allow_method_set_allow_methods(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
41+
ngx_http_allow_methods_set_allow_methods(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
4242
{
4343
#if (NGX_PCRE)
4444

45-
ngx_http_allow_method_loc_conf_t *clcf = conf;
45+
ngx_http_allow_methods_loc_conf_t *clcf = conf;
4646

4747
ngx_str_t *value;
4848
ngx_regex_compile_t rc;
@@ -77,25 +77,25 @@ ngx_http_allow_method_set_allow_methods(ngx_conf_t *cf, ngx_command_t *cmd, void
7777
#endif
7878
}
7979

80-
static ngx_http_module_t ngx_http_allow_method_module_ctx = {
80+
static ngx_http_module_t ngx_http_allow_methods_module_ctx = {
8181
NULL, /* preconfiguration */
82-
ngx_http_allow_method_init, /* postconfiguration */
82+
ngx_http_allow_methods_init, /* postconfiguration */
8383

8484
NULL, /* create main configuration */
8585
NULL, /* init main configuration */
8686

8787
NULL, /* create server configuration */
8888
NULL, /* merge server configuration */
8989

90-
ngx_http_allow_method_create_loc_conf, /* create location configuration */
91-
ngx_http_allow_method_merge_loc_conf /* merge location configuration */
90+
ngx_http_allow_methods_create_loc_conf, /* create location configuration */
91+
ngx_http_allow_methods_merge_loc_conf /* merge location configuration */
9292
};
9393

9494

95-
ngx_module_t ngx_http_allow_method_module = {
95+
ngx_module_t ngx_http_allow_methods_module = {
9696
NGX_MODULE_V1,
97-
&ngx_http_allow_method_module_ctx, /* module context */
98-
ngx_http_allow_method_commands, /* module directives */
97+
&ngx_http_allow_methods_module_ctx, /* module context */
98+
ngx_http_allow_methods_commands, /* module directives */
9999
NGX_HTTP_MODULE, /* module type */
100100
NULL, /* init master */
101101
NULL, /* init module */
@@ -109,17 +109,17 @@ ngx_module_t ngx_http_allow_method_module = {
109109

110110

111111
static ngx_int_t
112-
ngx_http_allow_method_handler(ngx_http_request_t *r)
112+
ngx_http_allow_methods_handler(ngx_http_request_t *r)
113113
{
114114
#if (NGX_PCRE)
115115
ngx_int_t rc;
116-
ngx_http_allow_method_loc_conf_t *clcf;
116+
ngx_http_allow_methods_loc_conf_t *clcf;
117117
int captures[1];
118118

119119
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
120-
"http allow_method handler");
120+
"http allow_methods handler");
121121

122-
clcf = ngx_http_get_module_loc_conf(r, ngx_http_allow_method_module);
122+
clcf = ngx_http_get_module_loc_conf(r, ngx_http_allow_methods_module);
123123

124124
if (clcf->regex == NULL) {
125125
return NGX_DECLINED;
@@ -132,7 +132,7 @@ ngx_http_allow_method_handler(ngx_http_request_t *r)
132132
}
133133

134134
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
135-
"http allow_method faking request method as POST (%d -> %d)", r->method, NGX_HTTP_UNKNOWN_BUT_ALLOWED);
135+
"http allow_methods faking request method as POST (%d -> %d)", r->method, NGX_HTTP_UNKNOWN_BUT_ALLOWED);
136136

137137
r->method = NGX_HTTP_UNKNOWN_BUT_ALLOWED;
138138

@@ -143,11 +143,11 @@ ngx_http_allow_method_handler(ngx_http_request_t *r)
143143

144144

145145
static void *
146-
ngx_http_allow_method_create_loc_conf(ngx_conf_t *cf)
146+
ngx_http_allow_methods_create_loc_conf(ngx_conf_t *cf)
147147
{
148-
ngx_http_allow_method_loc_conf_t *conf;
148+
ngx_http_allow_methods_loc_conf_t *conf;
149149

150-
conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_allow_method_loc_conf_t));
150+
conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_allow_methods_loc_conf_t));
151151
if (conf == NULL) {
152152
return NULL;
153153
}
@@ -169,10 +169,10 @@ ngx_http_allow_method_create_loc_conf(ngx_conf_t *cf)
169169

170170

171171
static char *
172-
ngx_http_allow_method_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
172+
ngx_http_allow_methods_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
173173
{
174-
ngx_http_allow_method_loc_conf_t *prev = parent;
175-
ngx_http_allow_method_loc_conf_t *conf = child;
174+
ngx_http_allow_methods_loc_conf_t *prev = parent;
175+
ngx_http_allow_methods_loc_conf_t *conf = child;
176176

177177
#if (NGX_PCRE)
178178
if (conf->regex == NULL) {
@@ -196,7 +196,7 @@ ngx_http_allow_method_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
196196

197197

198198
static ngx_int_t
199-
ngx_http_allow_method_init(ngx_conf_t *cf)
199+
ngx_http_allow_methods_init(ngx_conf_t *cf)
200200
{
201201
ngx_http_handler_pt *h;
202202
ngx_http_core_main_conf_t *cmcf;
@@ -208,7 +208,7 @@ ngx_http_allow_method_init(ngx_conf_t *cf)
208208
return NGX_ERROR;
209209
}
210210

211-
*h = ngx_http_allow_method_handler;
211+
*h = ngx_http_allow_methods_handler;
212212

213213
return NGX_OK;
214214
}

0 commit comments

Comments
 (0)