unit.h (802:fb9a6392d04a) unit.h (828:b9f7635e6be2)
1
2/*
3 * Copyright (C) NGINX, Inc.
4 */
5
6#ifndef _NXT_NODEJS_UNIT_H_INCLUDED_
7#define _NXT_NODEJS_UNIT_H_INCLUDED_
8

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

31 Unit(napi_env env);
32 ~Unit();
33
34 static napi_value create(napi_env env, napi_callback_info info);
35 static void destroy(napi_env env, void *nativeObject, void *finalize_hint);
36
37 static napi_value create_server(napi_env env, napi_callback_info info);
38 static napi_value listen(napi_env env, napi_callback_info info);
1
2/*
3 * Copyright (C) NGINX, Inc.
4 */
5
6#ifndef _NXT_NODEJS_UNIT_H_INCLUDED_
7#define _NXT_NODEJS_UNIT_H_INCLUDED_
8

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

31 Unit(napi_env env);
32 ~Unit();
33
34 static napi_value create(napi_env env, napi_callback_info info);
35 static void destroy(napi_env env, void *nativeObject, void *finalize_hint);
36
37 static napi_value create_server(napi_env env, napi_callback_info info);
38 static napi_value listen(napi_env env, napi_callback_info info);
39 static napi_value _read(napi_env env, napi_callback_info info);
39 static void request_handler(nxt_unit_request_info_t *req);
40 static void request_handler(nxt_unit_request_info_t *req);
41 static int add_port(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port);
42 static void remove_port(nxt_unit_ctx_t *ctx, nxt_unit_port_id_t *port_id);
40
41 napi_value get_server_object();
42
43
44 napi_value get_server_object();
45
43 napi_value emit(napi_value obj, const char *name, size_t name_len,
44 size_t argc, napi_value *argv);
45
46 napi_value create_socket(napi_value server_obj,
47 nxt_unit_request_info_t *req);
48
49 napi_value create_request(napi_value server_obj, napi_value socket);
50
51 napi_value create_response(napi_value server_obj, napi_value socket,
52 napi_value request,
53 nxt_unit_request_info_t *req, Unit *obj);
54
46 napi_value create_socket(napi_value server_obj,
47 nxt_unit_request_info_t *req);
48
49 napi_value create_request(napi_value server_obj, napi_value socket);
50
51 napi_value create_response(napi_value server_obj, napi_value socket,
52 napi_value request,
53 nxt_unit_request_info_t *req, Unit *obj);
54
55 void emit_post_data(napi_value request, nxt_unit_request_info_t *req);
56
57 static napi_value response_send_headers(napi_env env,
58 napi_callback_info info);
59
60 static napi_value response_write(napi_env env, napi_callback_info info);
61 static napi_value response_end(napi_env env, napi_callback_info info);
62
63 napi_status create_headers(nxt_unit_request_info_t *req,
64 napi_value request);

--- 13 unchanged lines hidden ---
55 static napi_value response_send_headers(napi_env env,
56 napi_callback_info info);
57
58 static napi_value response_write(napi_env env, napi_callback_info info);
59 static napi_value response_end(napi_env env, napi_callback_info info);
60
61 napi_status create_headers(nxt_unit_request_info_t *req,
62 napi_value request);

--- 13 unchanged lines hidden ---