]> git.kaiwu.me - njs.git/commit
Stream: improved s.send() with async callbacks.
authorDmitry Volyntsev <xeioex@nginx.com>
Wed, 24 Aug 2022 02:36:16 +0000 (19:36 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Wed, 24 Aug 2022 02:36:16 +0000 (19:36 -0700)
commit569292e0a74f2b1ec09566f3329f82bdd0d58e87
treee97eddef237807acffe05d430fe7c2b8e12469e4
parent399580ff3bb1f1a5f584afb6bf7fc42d2f90a6d8
Stream: improved s.send() with async callbacks.

Previously, s.send() was a context dependant method because the
direction it was sending data to was determined by a callback (upstream
or downstream) it was called from.  This works for synchronous
callbacks it was originally designed, but fails with async functions
(e.g. ngx.fetch()).

The fix is to store the direction data was going to as a separate flag
which can be used by s.send().
nginx/ngx_stream_js_module.c