Skip to content

Commit

Permalink
define ngx_http_secure_token_get_acl_iijpta() in iijpta/ngx_http_secu…
Browse files Browse the repository at this point in the history
…re_token_iijpta.c.
  • Loading branch information
kuroishi committed Mar 7, 2019
1 parent 57ffe34 commit 84cd911
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
21 changes: 21 additions & 0 deletions iijpta/ngx_http_secure_token_iijpta.c
Expand Up @@ -63,6 +63,27 @@ static ngx_command_t ngx_http_secure_token_iijpta_cmds[] = {
NULL },
};

static ngx_int_t
ngx_http_secure_token_get_acl_iijpta(ngx_http_request_t *r, ngx_http_complex_value_t *acl_conf, ngx_str_t* acl)
{
// get the acl
if (acl_conf != NULL)
{
if (ngx_http_complex_value(r, acl_conf, acl) != NGX_OK)
{
return NGX_ERROR;
}
}
else
{
// the default is '/*'
acl->data = (u_char *)"/*";
acl->len = sizeof("/*");
}

return NGX_OK;
}

static ngx_int_t
ngx_secure_token_iijpta_get_var(
ngx_http_request_t *r,
Expand Down
23 changes: 0 additions & 23 deletions ngx_http_secure_token_filter_module.c
Expand Up @@ -19,7 +19,6 @@

#define CACHE_CONTROL_FORMAT "%V, max-age=%T, max-stale=0"

//static char *ngx_conf_check_str_len_bounds(ngx_conf_t *cf, void *post, void *data);
static void *ngx_http_secure_token_create_loc_conf(ngx_conf_t *cf);
static char *ngx_http_secure_token_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child);
static ngx_int_t ngx_http_secure_token_add_variables(ngx_conf_t *cf);
Expand Down Expand Up @@ -531,28 +530,6 @@ ngx_http_secure_token_get_acl(ngx_http_request_t *r, ngx_http_complex_value_t *a
return NGX_OK;
}

ngx_int_t
ngx_http_secure_token_get_acl_iijpta(ngx_http_request_t *r, ngx_http_complex_value_t *acl_conf, ngx_str_t* acl)
{
// get the acl
if (acl_conf != NULL)
{
if (ngx_http_complex_value(r, acl_conf, acl) != NGX_OK)
{
return NGX_ERROR;
}
}
else
{
// the default is '/*'
acl->data = (u_char *)"/*";
acl->len = sizeof("/*");
}

return NGX_OK;
}


static void *
ngx_http_secure_token_memrchr(const u_char *s, int c, size_t n)
{
Expand Down
2 changes: 0 additions & 2 deletions ngx_http_secure_token_filter_module.h
Expand Up @@ -7,8 +7,6 @@
// functions
ngx_int_t ngx_http_secure_token_get_acl(ngx_http_request_t *r, ngx_http_complex_value_t *acl_conf, ngx_str_t* acl);

ngx_int_t ngx_http_secure_token_get_acl_iijpta(ngx_http_request_t *r, ngx_http_complex_value_t *acl_conf, ngx_str_t* acl);

// globals
extern ngx_module_t ngx_http_secure_token_filter_module;

Expand Down

0 comments on commit 84cd911

Please sign in to comment.