79e64b1233
*) Change: the "variables_hash_max_size" and "variables_hash_bucket_size" directives. *) Feature: the $body_bytes_sent variable can be used not only in the "log_format" directive. *) Feature: the $ssl_protocol and $ssl_cipher variables. *) Feature: the cache line size detection for widespread CPUs at start time. *) Feature: now the "accept_mutex" directive is supported using fcntl(2) on platforms different from i386, amd64, sparc64, and ppc. *) Feature: the "lock_file" directive and the --with-lock-path=PATH autoconfiguration directive. *) Bugfix: if the HTTPS protocol was used in the "proxy_pass" directive then the requests with the body was not transferred.
72 lines
2 KiB
C
72 lines
2 KiB
C
|
|
/*
|
|
* Copyright (C) Igor Sysoev
|
|
*/
|
|
|
|
|
|
#ifndef _NGX_HTTP_VARIABLES_H_INCLUDED_
|
|
#define _NGX_HTTP_VARIABLES_H_INCLUDED_
|
|
|
|
|
|
#include <ngx_config.h>
|
|
#include <ngx_core.h>
|
|
#include <ngx_event.h>
|
|
#include <ngx_http.h>
|
|
|
|
|
|
typedef struct {
|
|
unsigned len:29;
|
|
|
|
unsigned valid:1;
|
|
unsigned no_cachable:1;
|
|
unsigned not_found:1;
|
|
|
|
u_char *data;
|
|
} ngx_http_variable_value_t;
|
|
|
|
#define ngx_http_variable(v) { sizeof(v) - 1, 1, 0, 0, (u_char *) v }
|
|
|
|
typedef struct ngx_http_variable_s ngx_http_variable_t;
|
|
|
|
typedef ngx_int_t (*ngx_http_get_variable_pt) (ngx_http_request_t *r,
|
|
ngx_http_variable_value_t *v, uintptr_t data);
|
|
|
|
|
|
#define NGX_HTTP_VAR_CHANGABLE 1
|
|
#define NGX_HTTP_VAR_NOCACHABLE 2
|
|
#define NGX_HTTP_VAR_INDEXED 4
|
|
#define NGX_HTTP_VAR_NOHASH 8
|
|
|
|
|
|
struct ngx_http_variable_s {
|
|
ngx_str_t name; /* must be first to build the hash */
|
|
ngx_http_get_variable_pt handler;
|
|
uintptr_t data;
|
|
ngx_uint_t flags;
|
|
ngx_uint_t index;
|
|
};
|
|
|
|
|
|
ngx_http_variable_t *ngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name,
|
|
ngx_uint_t flags);
|
|
ngx_int_t ngx_http_get_variable_index(ngx_conf_t *cf, ngx_str_t *name);
|
|
ngx_http_variable_value_t *ngx_http_get_indexed_variable(ngx_http_request_t *r,
|
|
ngx_uint_t index);
|
|
ngx_http_variable_value_t *ngx_http_get_flushed_variable(ngx_http_request_t *r,
|
|
ngx_uint_t index);
|
|
|
|
ngx_http_variable_value_t *ngx_http_get_variable(ngx_http_request_t *r,
|
|
ngx_str_t *name, ngx_uint_t key);
|
|
|
|
#define ngx_http_clear_variable(r, index) r->variables0[index].text.data = NULL;
|
|
|
|
|
|
ngx_int_t ngx_http_variables_add_core_vars(ngx_conf_t *cf);
|
|
ngx_int_t ngx_http_variables_init_vars(ngx_conf_t *cf);
|
|
|
|
|
|
extern ngx_http_variable_value_t ngx_http_variable_null_value;
|
|
extern ngx_http_variable_value_t ngx_http_variable_true_value;
|
|
|
|
|
|
#endif /* _NGX_HTTP_VARIABLES_H_INCLUDED_ */
|