Skip to content

Commit 413162c

Browse files
committed
Directives for jvm int/exit handler properties #282
1 parent d5d9250 commit 413162c

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

src/c/ngx_http_clojure_mem.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ typedef unsigned __int64 uint64_t;
4141
#define JVM_CP_SEP_S ":"
4242
#endif
4343

44-
#define nginx_clojure_ver 6000 /*0.6.0*/
44+
#define nginx_clojure_ver 6001 /*0.6.0*/
4545

4646
/*the least jar version required*/
4747
#define nginx_clojure_required_rt_lver 5002
4848

49-
#define NGINX_CLOJURE_VER_NUM_STR "0.6.0"
49+
#define NGINX_CLOJURE_VER_NUM_STR "0.6.1"
5050

5151
#define NGINX_CLOJURE_VER "nginx-clojure/" NGINX_CLOJURE_VER_NUM_STR
5252

@@ -90,9 +90,11 @@ typedef struct {
9090
ngx_str_t jvm_init_handler_code;
9191
ngx_int_t jvm_init_handler_id;
9292
ngx_str_t jvm_init_handler_name;
93+
ngx_array_t *jvm_init_handler_properties;
9394
ngx_str_t jvm_exit_handler_code;
9495
ngx_int_t jvm_exit_handler_id;
9596
ngx_str_t jvm_exit_handler_name;
97+
ngx_array_t *jvm_exit_handler_properties;
9698
ngx_hash_t headers_out_holder_hash;
9799
} ngx_http_clojure_main_conf_t;
98100

src/c/ngx_http_clojure_module.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,14 @@ static ngx_command_t ngx_http_clojure_commands[] = {
224224
offsetof(ngx_http_clojure_main_conf_t, jvm_init_handler_code),
225225
NULL
226226
},
227+
{
228+
ngx_string("jvm_init_handler_property"),
229+
NGX_HTTP_MAIN_CONF | NGX_CONF_TAKE2,
230+
ngx_conf_set_keyval_slot,
231+
NGX_HTTP_MAIN_CONF_OFFSET,
232+
offsetof(ngx_http_clojure_main_conf_t, jvm_init_handler_properties),
233+
NULL
234+
},
227235
{
228236
ngx_string("jvm_exit_handler_name"),
229237
NGX_HTTP_MAIN_CONF | NGX_CONF_TAKE1,
@@ -240,6 +248,14 @@ static ngx_command_t ngx_http_clojure_commands[] = {
240248
offsetof(ngx_http_clojure_main_conf_t, jvm_exit_handler_code),
241249
NULL
242250
},
251+
{
252+
ngx_string("jvm_exit_handler_property"),
253+
NGX_HTTP_MAIN_CONF | NGX_CONF_TAKE2,
254+
ngx_conf_set_keyval_slot,
255+
NGX_HTTP_MAIN_CONF_OFFSET,
256+
offsetof(ngx_http_clojure_main_conf_t, jvm_exit_handler_properties),
257+
NULL
258+
},
243259
{
244260
ngx_string("handlers_lazy_init"),
245261
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_CONF_TAKE1,
@@ -1298,13 +1314,13 @@ static ngx_int_t ngx_http_clojure_process_init(ngx_cycle_t *cycle) {
12981314

12991315
if (mcf->enable_init_handler
13001316
&& ngx_http_clojure_init_clojure_script(NGX_HTTP_INIT_PROCESS_PHASE, "init-process", &mcf->jvm_handler_type, &mcf->jvm_init_handler_name,
1301-
&mcf->jvm_init_handler_code, NULL, &mcf->jvm_init_handler_id, cycle->log) != NGX_HTTP_CLOJURE_JVM_OK) {
1317+
&mcf->jvm_init_handler_code, mcf->jvm_init_handler_properties, &mcf->jvm_init_handler_id, cycle->log) != NGX_HTTP_CLOJURE_JVM_OK) {
13021318
return NGX_ERROR;
13031319
}
13041320

13051321
if (mcf->enable_exit_handler
13061322
&& ngx_http_clojure_init_clojure_script(NGX_HTTP_EXIT_PROCESS_PHASE, "exit-process", &mcf->jvm_handler_type, &mcf->jvm_exit_handler_name,
1307-
&mcf->jvm_exit_handler_code, NULL, &mcf->jvm_exit_handler_id, cycle->log) != NGX_HTTP_CLOJURE_JVM_OK) {
1323+
&mcf->jvm_exit_handler_code, mcf->jvm_exit_handler_properties, &mcf->jvm_exit_handler_id, cycle->log) != NGX_HTTP_CLOJURE_JVM_OK) {
13081324
return NGX_ERROR;
13091325
}
13101326

0 commit comments

Comments
 (0)