summaryrefslogtreecommitdiffhomepage
path: root/src/nodejs/unit-http/unit.h
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-12-29 19:00:54 +0300
committerMax Romanov <max.romanov@nginx.com>2020-12-29 19:00:54 +0300
commitd3d6864bdc64f34924e686ff65da704b29aaaa93 (patch)
treecf8c42d762fd9345143c3fa5c3ecb04d250e13ee /src/nodejs/unit-http/unit.h
parent3abca42caf44f03941545e5e92f35c0f329640e7 (diff)
downloadunit-d3d6864bdc64f34924e686ff65da704b29aaaa93.tar.gz
unit-d3d6864bdc64f34924e686ff65da704b29aaaa93.tar.bz2
Node.js: ServerRequest and ServerResponse compliance to Stream API.
ServerRequest now inherit stream Readable object. ServerResponse provides 'writable' property. Thanks to Wu Jian Ping (@wujjpp). This closes #274, closes #317 issues and closes #502 PR on GitHub.
Diffstat (limited to 'src/nodejs/unit-http/unit.h')
-rw-r--r--src/nodejs/unit-http/unit.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nodejs/unit-http/unit.h b/src/nodejs/unit-http/unit.h
index 07823c26..4ef40d45 100644
--- a/src/nodejs/unit-http/unit.h
+++ b/src/nodejs/unit-http/unit.h
@@ -21,6 +21,7 @@ private:
static void destroy(napi_env env, void *nativeObject, void *finalize_hint);
static void conn_destroy(napi_env env, void *nativeObject, void *finalize_hint);
static void sock_destroy(napi_env env, void *nativeObject, void *finalize_hint);
+ static void req_destroy(napi_env env, void *nativeObject, void *finalize_hint);
static void resp_destroy(napi_env env, void *nativeObject, void *finalize_hint);
static napi_value create_server(napi_env env, napi_callback_info info);
@@ -50,7 +51,8 @@ private:
napi_value create_socket(napi_value server_obj,
nxt_unit_request_info_t *req);
- napi_value create_request(napi_value server_obj, napi_value socket);
+ napi_value create_request(napi_value server_obj, napi_value socket,
+ nxt_unit_request_info_t *req);
napi_value create_response(napi_value server_obj, napi_value request,
nxt_unit_request_info_t *req);
@@ -58,6 +60,8 @@ private:
napi_value create_websocket_frame(napi_value server_obj,
nxt_unit_websocket_frame_t *ws);
+ static napi_value request_read(napi_env env, napi_callback_info info);
+
static napi_value response_send_headers(napi_env env,
napi_callback_info info);