Mercurial > hg > nginx
annotate src/http/ngx_http_variables.h @ 1960:1609b3c3d604
fix memory leak on resolver query send failure
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 09 Apr 2008 14:26:08 +0000 |
parents | 4c43e25d11ea |
children | 66dc85397a90 |
rev | line source |
---|---|
499 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #ifndef _NGX_HTTP_VARIABLES_H_INCLUDED_ | |
8 #define _NGX_HTTP_VARIABLES_H_INCLUDED_ | |
9 | |
10 | |
11 #include <ngx_config.h> | |
12 #include <ngx_core.h> | |
13 #include <ngx_event.h> | |
14 #include <ngx_http.h> | |
15 | |
16 | |
1310
33d6c994a0b2
Sun Studio on sparc uses different bit order
Igor Sysoev <igor@sysoev.ru>
parents:
1162
diff
changeset
|
17 typedef ngx_variable_value_t ngx_http_variable_value_t; |
499 | 18 |
573 | 19 #define ngx_http_variable(v) { sizeof(v) - 1, 1, 0, 0, (u_char *) v } |
20 | |
499 | 21 typedef struct ngx_http_variable_s ngx_http_variable_t; |
22 | |
637 | 23 typedef void (*ngx_http_set_variable_pt) (ngx_http_request_t *r, |
24 ngx_http_variable_value_t *v, uintptr_t data); | |
573 | 25 typedef ngx_int_t (*ngx_http_get_variable_pt) (ngx_http_request_t *r, |
26 ngx_http_variable_value_t *v, uintptr_t data); | |
499 | 27 |
28 | |
1565 | 29 #define NGX_HTTP_VAR_CHANGEABLE 1 |
30 #define NGX_HTTP_VAR_NOCACHEABLE 2 | |
31 #define NGX_HTTP_VAR_INDEXED 4 | |
32 #define NGX_HTTP_VAR_NOHASH 8 | |
509 | 33 |
34 | |
499 | 35 struct ngx_http_variable_s { |
573 | 36 ngx_str_t name; /* must be first to build the hash */ |
637 | 37 ngx_http_set_variable_pt set_handler; |
38 ngx_http_get_variable_pt get_handler; | |
573 | 39 uintptr_t data; |
40 ngx_uint_t flags; | |
41 ngx_uint_t index; | |
499 | 42 }; |
43 | |
44 | |
501 | 45 ngx_http_variable_t *ngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name, |
509 | 46 ngx_uint_t flags); |
47 ngx_int_t ngx_http_get_variable_index(ngx_conf_t *cf, ngx_str_t *name); | |
499 | 48 ngx_http_variable_value_t *ngx_http_get_indexed_variable(ngx_http_request_t *r, |
49 ngx_uint_t index); | |
573 | 50 ngx_http_variable_value_t *ngx_http_get_flushed_variable(ngx_http_request_t *r, |
51 ngx_uint_t index); | |
52 | |
499 | 53 ngx_http_variable_value_t *ngx_http_get_variable(ngx_http_request_t *r, |
635 | 54 ngx_str_t *name, ngx_uint_t key, ngx_uint_t nowarn); |
509 | 55 |
1162 | 56 ngx_int_t ngx_http_variable_unknown_header(ngx_http_variable_value_t *v, |
57 ngx_str_t *var, ngx_list_part_t *part, size_t prefix); | |
58 | |
59 | |
573 | 60 #define ngx_http_clear_variable(r, index) r->variables0[index].text.data = NULL; |
61 | |
62 | |
509 | 63 ngx_int_t ngx_http_variables_add_core_vars(ngx_conf_t *cf); |
64 ngx_int_t ngx_http_variables_init_vars(ngx_conf_t *cf); | |
499 | 65 |
66 | |
577 | 67 extern ngx_http_variable_value_t ngx_http_variable_null_value; |
68 extern ngx_http_variable_value_t ngx_http_variable_true_value; | |
69 | |
70 | |
499 | 71 #endif /* _NGX_HTTP_VARIABLES_H_INCLUDED_ */ |