31 static void *ngx_http_secure_link_create_conf(
ngx_conf_t *cf);
32 static char *ngx_http_secure_link_merge_conf(
ngx_conf_t *cf,
void *parent,
65 ngx_http_secure_link_add_variables,
74 ngx_http_secure_link_create_conf,
75 ngx_http_secure_link_merge_conf
81 &ngx_http_secure_link_module_ctx,
82 ngx_http_secure_link_commands,
96 static ngx_str_t ngx_http_secure_link_expires_name =
110 u_char hash_buf[16], md5_buf[16];
115 return ngx_http_secure_link_old_variable(r, conf, v, data);
127 "secure link: \"%V\"", &val);
131 p = ngx_strlchr(val.
data, last,
',');
158 hash.
data = hash_buf;
164 if (hash.
len != 16) {
173 "secure link md5: \"%V\"", &val);
183 v->
data = (u_char *) ((expires && expires <
ngx_time()) ?
"0" :
"1");
204 u_char *p, *start, *end, *last;
238 if (end - start != 32 || len == 0) {
247 for (i = 0; i < 16; i++) {
294 ngx_http_secure_link_create_conf(
ngx_conf_t *cf)
316 ngx_http_secure_link_merge_conf(
ngx_conf_t *cf,
void *parent,
void *child)
324 "\"secure_link_secret\" cannot be mixed with "
325 "\"secure_link\" and \"secure_link_md5\"");
336 if (conf->
md5 == NULL) {
349 ngx_http_secure_link_add_variables(
ngx_conf_t *cf)
365 var->
get_handler = ngx_http_secure_link_expires_variable;