Deleted
Added
unit.cpp (1020:53533ba0097c) | unit.cpp (1021:8884d891d4c7) |
---|---|
1 2/* 3 * Copyright (C) NGINX, Inc. 4 */ 5 6#include "unit.h" 7 8#include <unistd.h> --- 299 unchanged lines hidden (view full) --- 308 309 nxt_unit_remove_port(ctx, port_id); 310} 311 312 313void 314Unit::quit(nxt_unit_ctx_t *ctx) 315{ | 1 2/* 3 * Copyright (C) NGINX, Inc. 4 */ 5 6#include "unit.h" 7 8#include <unistd.h> --- 299 unchanged lines hidden (view full) --- 308 309 nxt_unit_remove_port(ctx, port_id); 310} 311 312 313void 314Unit::quit(nxt_unit_ctx_t *ctx) 315{ |
316 Unit *obj; 317 napi_value server_obj, emit_close; 318 319 obj = reinterpret_cast<Unit *>(ctx->unit->data); 320 321 try { 322 nxt_handle_scope scope(obj->env()); 323 324 server_obj = obj->get_server_object(); 325 326 emit_close = obj->get_named_property(server_obj, "emit_close"); 327 328 nxt_async_context async_context(obj->env(), "unit_quit"); 329 nxt_callback_scope async_scope(async_context); 330 331 obj->make_callback(async_context, server_obj, emit_close, 0, NULL); 332 333 } catch (exception &e) { 334 obj->throw_error(e); 335 } 336 |
|
316 nxt_unit_done(ctx); 317} 318 319 320napi_value 321Unit::get_server_object() 322{ 323 napi_value unit_obj; --- 350 unchanged lines hidden --- | 337 nxt_unit_done(ctx); 338} 339 340 341napi_value 342Unit::get_server_object() 343{ 344 napi_value unit_obj; --- 350 unchanged lines hidden --- |