nxt_java.c (1684:a10e10f3071f) nxt_java.c (1980:43553aa72111)
1
2/*
3 * Copyright (C) NGINX, Inc.
4 */
5
6
7#include <jni.h>
8

--- 414 unchanged lines hidden (view full) ---

423 return NXT_ERROR;
424 }
425
426 rc = nxt_java_init_threads(c);
427 if (nxt_slow_path(rc == NXT_UNIT_ERROR)) {
428 return NXT_ERROR;
429 }
430
1
2/*
3 * Copyright (C) NGINX, Inc.
4 */
5
6
7#include <jni.h>
8

--- 414 unchanged lines hidden (view full) ---

423 return NXT_ERROR;
424 }
425
426 rc = nxt_java_init_threads(c);
427 if (nxt_slow_path(rc == NXT_UNIT_ERROR)) {
428 return NXT_ERROR;
429 }
430
431 nxt_unit_default_init(task, &java_init);
431 nxt_unit_default_init(task, &java_init, app_conf);
432
433 java_init.callbacks.request_handler = nxt_java_request_handler;
434 java_init.callbacks.websocket_handler = nxt_java_websocket_handler;
435 java_init.callbacks.close_handler = nxt_java_close_handler;
436 java_init.callbacks.ready_handler = nxt_java_ready_handler;
437 java_init.request_data_size = sizeof(nxt_java_request_data_t);
438 java_init.data = &java_data;
439 java_init.ctx_data = env;
432
433 java_init.callbacks.request_handler = nxt_java_request_handler;
434 java_init.callbacks.websocket_handler = nxt_java_websocket_handler;
435 java_init.callbacks.close_handler = nxt_java_close_handler;
436 java_init.callbacks.ready_handler = nxt_java_ready_handler;
437 java_init.request_data_size = sizeof(nxt_java_request_data_t);
438 java_init.data = &java_data;
439 java_init.ctx_data = env;
440 java_init.shm_limit = app_conf->shm_limit;
441
442 ctx = nxt_unit_init(&java_init);
443 if (nxt_slow_path(ctx == NULL)) {
444 nxt_alert(task, "nxt_unit_init() failed");
445 return NXT_ERROR;
446 }
447
448 rc = nxt_unit_run(ctx);

--- 162 unchanged lines hidden (view full) ---

611static int
612nxt_java_ready_handler(nxt_unit_ctx_t *ctx)
613{
614 int res;
615 uint32_t i;
616 nxt_java_data_t *java_data;
617 nxt_java_app_conf_t *c;
618
440
441 ctx = nxt_unit_init(&java_init);
442 if (nxt_slow_path(ctx == NULL)) {
443 nxt_alert(task, "nxt_unit_init() failed");
444 return NXT_ERROR;
445 }
446
447 rc = nxt_unit_run(ctx);

--- 162 unchanged lines hidden (view full) ---

610static int
611nxt_java_ready_handler(nxt_unit_ctx_t *ctx)
612{
613 int res;
614 uint32_t i;
615 nxt_java_data_t *java_data;
616 nxt_java_app_conf_t *c;
617
619 /* Worker thread context. */
620 if (!nxt_unit_is_main_ctx(ctx)) {
621 return NXT_UNIT_OK;
622 }
623
624 java_data = ctx->unit->data;
625 c = java_data->conf;
626
627 if (c->threads <= 1) {
628 return NXT_UNIT_OK;
629 }
630
631 for (i = 0; i < c->threads - 1; i++) {

--- 135 unchanged lines hidden ---
618 java_data = ctx->unit->data;
619 c = java_data->conf;
620
621 if (c->threads <= 1) {
622 return NXT_UNIT_OK;
623 }
624
625 for (i = 0; i < c->threads - 1; i++) {

--- 135 unchanged lines hidden ---