[njs] Stream: introduced s.sendUpstream() and s.sendDownstream().

Dmitry Volyntsev xeioex at nginx.com
Tue Sep 27 01:23:11 UTC 2022


details:   https://hg.nginx.org/njs/rev/301cc9eaa3bf
branches:  
changeset: 1963:301cc9eaa3bf
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Mon Sep 26 17:50:24 2022 -0700
description:
Stream: introduced s.sendUpstream() and s.sendDownstream().

diffstat:

 nginx/ngx_stream_js_module.c |  24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diffs (34 lines):

diff -r 7a4f1f8a2cae -r 301cc9eaa3bf nginx/ngx_stream_js_module.c
--- a/nginx/ngx_stream_js_module.c	Mon Sep 26 17:49:39 2022 -0700
+++ b/nginx/ngx_stream_js_module.c	Mon Sep 26 17:50:24 2022 -0700
@@ -448,6 +448,30 @@ static njs_external_t  ngx_stream_js_ext
 
     {
         .flags = NJS_EXTERN_METHOD,
+        .name.string = njs_str("sendDownstream"),
+        .writable = 1,
+        .configurable = 1,
+        .enumerable = 1,
+        .u.method = {
+            .native = ngx_stream_js_ext_send,
+            .magic8 = NGX_JS_BOOL_TRUE,
+        }
+    },
+
+    {
+        .flags = NJS_EXTERN_METHOD,
+        .name.string = njs_str("sendUpstream"),
+        .writable = 1,
+        .configurable = 1,
+        .enumerable = 1,
+        .u.method = {
+            .native = ngx_stream_js_ext_send,
+            .magic8 = NGX_JS_BOOL_FALSE,
+        }
+    },
+
+    {
+        .flags = NJS_EXTERN_METHOD,
         .name.string = njs_str("setReturnValue"),
         .writable = 1,
         .configurable = 1,



More information about the nginx-devel mailing list