@@ -41,7 +41,7 @@ typedef unsigned __int64 uint64_t;
41
41
#define JVM_CP_SEP_S ":"
42
42
#endif
43
43
44
- #define nginx_clojure_ver 6001 /*0.6.0 */
44
+ #define nginx_clojure_ver 6001 /*0.6.1 */
45
45
46
46
/*the least jar version required*/
47
47
#define nginx_clojure_required_rt_lver 5002
@@ -50,6 +50,9 @@ typedef unsigned __int64 uint64_t;
50
50
51
51
#define NGINX_CLOJURE_VER "nginx-clojure/" NGINX_CLOJURE_VER_NUM_STR
52
52
53
+ /*fake phase for load balance handler*/
54
+ #define NGX_HTTP_LOAD_BALANCE_PHASE 16
55
+
53
56
/*fake phase for filter*/
54
57
#define NGX_HTTP_INIT_PROCESS_PHASE 17
55
58
#define NGX_HTTP_HEADER_FILTER_PHASE 18
@@ -86,6 +89,7 @@ typedef struct {
86
89
unsigned enable_body_filter :1 ;
87
90
unsigned enable_access_handler : 1 ;
88
91
unsigned enable_log_handler : 1 ;
92
+ unsigned enable_load_balancer : 1 ;
89
93
ngx_str_t jvm_handler_type ;
90
94
ngx_str_t jvm_init_handler_code ;
91
95
ngx_int_t jvm_init_handler_id ;
@@ -146,6 +150,27 @@ typedef struct {
146
150
size_t write_page_size ;
147
151
} ngx_http_clojure_loc_conf_t ;
148
152
153
+
154
+ typedef struct {
155
+ unsigned enable_load_balancer :1 ;
156
+ ngx_str_t load_balancer_type ;
157
+ ngx_str_t load_balancer_code ;
158
+ ngx_int_t load_balancer_id ;
159
+ ngx_str_t load_balancer_name ;
160
+ ngx_array_t * load_balancer_properties ;
161
+ } ngx_http_clojure_srv_conf_t ;
162
+
163
+ typedef struct {
164
+ /* the round robin data must be first */
165
+ ngx_http_upstream_rr_peer_data_t rrp ;
166
+ ngx_http_clojure_srv_conf_t * conf ;
167
+ ngx_http_request_t * r ;
168
+ ngx_int_t peer_pos_or_len ;
169
+ u_char * peer_url ;
170
+ /* ngx_uint_t tries; */
171
+ /* ngx_event_get_peer_pt get_rr_peer; */
172
+ } ngx_http_clojure_upstream_load_balancer_peer_data_t ;
173
+
149
174
typedef struct ngx_http_clojure_listener_node_s {
150
175
void * listener ;
151
176
void * data ;
@@ -606,7 +631,7 @@ int ngx_http_clojure_destroy_memory_util(ngx_log_t *log);
606
631
int ngx_http_clojure_register_script (ngx_int_t phase , ngx_str_t * handler_type ,
607
632
ngx_str_t * handler , ngx_str_t * code , ngx_array_t * pros , ngx_int_t * pcid );
608
633
609
- int ngx_http_clojure_eval (int cid , ngx_http_request_t * r , ngx_chain_t * c );
634
+ int ngx_http_clojure_eval (int cid , ngx_http_request_t * r , void * c );
610
635
611
636
ngx_int_t ngx_http_clojure_hijack_send_header (ngx_http_request_t * r , ngx_int_t flag );
612
637
0 commit comments