This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| commit 8bde90b077a71bc0b3ce9331ae094a333ea35383 | |
| Author: Dmitry Volyntsev <[email protected]> | |
| Date: Tue Aug 26 14:22:19 2025 -0700 | |
| QuickJS: added njs.on('exit') API support. | |
| diff --git a/external/njs_shell.c b/external/njs_shell.c | |
| index 75316339..dd4e08ba 100644 | |
| --- a/external/njs_shell.c | |
| +++ b/external/njs_shell.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| commit 8bde90b077a71bc0b3ce9331ae094a333ea35383 | |
| Author: Dmitry Volyntsev <[email protected]> | |
| Date: Tue Aug 26 14:22:19 2025 -0700 | |
| QuickJS: added njs.on('exit') API support. | |
| diff --git a/external/njs_shell.c b/external/njs_shell.c | |
| index 75316339..dd4e08ba 100644 | |
| --- a/external/njs_shell.c | |
| +++ b/external/njs_shell.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| commit 10d48ea095ea51067fecd666696e0ce5295208aa | |
| Author: Dmitry Volyntsev <[email protected]> | |
| Date: Mon Aug 25 16:47:43 2025 -0700 | |
| Fixed building QuickJS support with clang 19. | |
| checking for QuickJS library -lquickjs In file included from | |
| build/autotest.c:6: | |
| /home/xeioex/workspace/nginx/nginScript/quickjs/quickjs.h:1052:34: | |
| error: cast from 'JSCFunctionMagic *' (aka 'struct JSValue (*)(struct |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/qjs.c b/src/qjs.c | |
| index 9c0fcdb4..ca2bdbbc 100644 | |
| --- a/src/qjs.c | |
| +++ b/src/qjs.c | |
| @@ -19,6 +19,12 @@ typedef struct { | |
| } qjs_signal_entry_t; | |
| +typedef struct { | |
| +#define QJS_NJS_HOOK_EXIT 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [1mdiff --git a/src/qjs.c b/src/qjs.c[m | |
| [1mindex 9c0fcdb4..ca2bdbbc 100644[m | |
| [1m--- a/src/qjs.c[m | |
| [1m+++ b/src/qjs.c[m | |
| [36m@@ -19,6 +19,12 @@[m [mtypedef struct {[m | |
| } qjs_signal_entry_t;[m | |
| [m | |
| [m | |
| [32m+[m[32mtypedef struct {[m | |
| [32m+[m[32m#define QJS_NJS_HOOK_EXIT 0[m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net" | |
| "os" | |
| "strconv" | |
| "sync" | |
| "time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/Dockerfile b/Dockerfile | |
| index e5548275..770ba067 100644 | |
| --- a/Dockerfile | |
| +++ b/Dockerfile | |
| @@ -1,5 +1,4 @@ | |
| ARG NGX_VERSION=1.28.0 | |
| -ARG NGX_CONFIGURE_ARGS= | |
| # NGINX official images are available for one specific release of Debian, | |
| # e.g `nginx:1.28.0-bookworm`. Please see the list of tags on docker hub | |
| # if you need to change NGX_VERSION. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/nginx/ngx_js.c b/nginx/ngx_js.c | |
| index 5f9ea2fb..06b07f98 100644 | |
| --- a/nginx/ngx_js.c | |
| +++ b/nginx/ngx_js.c | |
| @@ -691,10 +691,9 @@ ngx_engine_njs_call(ngx_js_ctx_t *ctx, ngx_str_t *fname, | |
| njs_opaque_value_t *args, njs_uint_t nargs) | |
| { | |
| njs_vm_t *vm; | |
| - njs_int_t ret; | |
| + njs_int_t ret, job_count; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use alloc::boxed::Box; | |
| use core::future::{Future, poll_fn}; | |
| use core::pin::Pin; | |
| use core::task::{Context, Poll, Waker}; | |
| use ngx::async_::Task; | |
| use wasmtime_wasi_io::async_trait; | |
| use wasmtime_wasi_io::poll::Pollable; | |
| /// A Job is an Task (ngx::async_ is re-exporting async-task::Task) that | |
| /// integrates with the Pollable trait to check for completion, and gives |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use anyhow::{Context, Result, anyhow}; | |
| use wasi::http::types::{ | |
| ErrorCode, IncomingBody, IncomingRequest, OutgoingBody, OutgoingRequest, OutgoingResponse, | |
| ResponseOutparam, Scheme, | |
| }; | |
| use wasi::io::streams::StreamError; | |
| wasi::http::proxy::export!(TestComponent); | |
| struct TestComponent; |