/
ngx_http_drizzle_module.h
94 lines (64 loc) · 2.29 KB
/
ngx_http_drizzle_module.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#ifndef NGX_HTTP_DRIZZLE_MODULE_H
#define NGX_HTTP_DRIZZLE_MODULE_H
#include <ngx_config.h>
#include <nginx.h>
#include <ngx_http.h>
/* XXX nginx undefines "bool", which breaks the libdrizzle 1.0 API
* which makes use of "bool" */
#if defined(__GNUC__)
# ifndef bool
# define bool _Bool
# endif
#endif
#include <libdrizzle/drizzle_client.h>
#ifndef NGX_HTTP_GONE
#define NGX_HTTP_GONE 410
#endif
#define ngx_http_drizzle_module_version 15
#define ngx_http_drizzle_module_version_string \
"0.0.15"
extern ngx_module_t ngx_http_drizzle_module;
typedef struct {
ngx_uint_t key;
ngx_str_t sv;
ngx_http_complex_value_t *cv;
} ngx_drizzle_mixed_t;
typedef struct {
u_char *name;
uint32_t key;
} ngx_drizzle_http_method_t;
typedef struct {
ngx_http_upstream_conf_t upstream;
/* drizzle database name */
ngx_http_complex_value_t *dbname;
/* SQL query to be executed */
ngx_drizzle_mixed_t *default_query;
ngx_uint_t methods_set;
ngx_array_t *queries;
ngx_msec_t recv_cols_timeout;
ngx_msec_t recv_rows_timeout;
ngx_flag_t enable_module_header;
/* for quoting */
ngx_array_t *vars_to_quote;
/* of ngx_http_drizzle_var_to_quote_t */
ngx_array_t *user_types;
/* of ngx_http_drizzle_var_type_t */
ngx_http_complex_value_t *complex_target;
size_t buf_size;
ngx_int_t tid_var_index; /* thread id variable
index */
} ngx_http_drizzle_loc_conf_t;
#if defined(nginx_version) && (nginx_version < 8017)
typedef struct {
ngx_int_t status;
} ngx_http_drizzle_ctx_t;
#endif
/* states for the drizzle client state machine */
typedef enum {
state_db_connect,
state_db_send_query,
state_db_recv_cols,
state_db_recv_rows,
state_db_idle
} ngx_http_drizzle_state_t;
#endif /* NGX_HTTP_DRIZZLE_MODULE_H */