@openziti/ziti-sdk-nodejs 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build.yml +4 -11
- package/package.json +1 -1
- package/src/ziti-add-on.c +6 -3
- package/src/ziti_init.c +0 -22
|
@@ -30,7 +30,7 @@ jobs:
|
|
|
30
30
|
strategy:
|
|
31
31
|
matrix:
|
|
32
32
|
config:
|
|
33
|
-
# - {
|
|
33
|
+
# - { os: windows-latest, cc: "cl", cxx: "cl", node: '16' }
|
|
34
34
|
- { os: ubuntu-18.04, cc: "gcc", cxx: "g++", node: '12' }
|
|
35
35
|
- { os: ubuntu-18.04, cc: "gcc", cxx: "g++", node: '13' }
|
|
36
36
|
- { os: ubuntu-18.04, cc: "gcc", cxx: "g++", node: '14' }
|
|
@@ -197,19 +197,12 @@ jobs:
|
|
|
197
197
|
run: |
|
|
198
198
|
npm run build:cleanup
|
|
199
199
|
|
|
200
|
-
- name: Publish Binary to S3 (
|
|
200
|
+
- name: Publish Binary to S3 (for all OS's, Node versions, and architectures)
|
|
201
201
|
run: |
|
|
202
202
|
./node_modules/.bin/node-pre-gyp package unpublish publish
|
|
203
203
|
sleep 5
|
|
204
204
|
if: |
|
|
205
|
-
steps.extract_branch.outputs.branch == 'main'
|
|
206
|
-
|
|
207
|
-
- name: Publish Binary to S3 (Linux)
|
|
208
|
-
run: |
|
|
209
|
-
./node_modules/.bin/node-pre-gyp package unpublish publish
|
|
210
|
-
sleep 5
|
|
211
|
-
if: |
|
|
212
|
-
steps.extract_branch.outputs.branch == 'main' && matrix.config.os == 'ubuntu-18.04' && matrix.config.node != '14'
|
|
205
|
+
steps.extract_branch.outputs.branch == 'main'
|
|
213
206
|
|
|
214
207
|
- name: Install Binary
|
|
215
208
|
run: |
|
|
@@ -228,4 +221,4 @@ jobs:
|
|
|
228
221
|
token: ${{ secrets.NPM_TOKEN }}
|
|
229
222
|
access: public
|
|
230
223
|
if: |
|
|
231
|
-
matrix.config.os == 'ubuntu-18.04' && matrix.config.node == '
|
|
224
|
+
matrix.config.os == 'ubuntu-18.04' && matrix.config.node == '16' && matrix.architecture == 'x64' && steps.extract_branch.outputs.branch == 'main'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openziti/ziti-sdk-nodejs",
|
|
3
3
|
"description": "A NodeJS-based SDK for delivering secure applications over a Ziti Network",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.1",
|
|
5
5
|
"main": "./lib/ziti",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "npm run build:init; npm run build:c-sdk; npm install --build-from-source --clang=1",
|
package/src/ziti-add-on.c
CHANGED
|
@@ -21,9 +21,6 @@ extern void set_signal_handler();
|
|
|
21
21
|
|
|
22
22
|
napi_value Init(napi_env env, napi_value exports) {
|
|
23
23
|
|
|
24
|
-
//
|
|
25
|
-
thread_loop = NULL;
|
|
26
|
-
|
|
27
24
|
if (uv_mutex_init(&client_pool_lock))
|
|
28
25
|
abort();
|
|
29
26
|
|
|
@@ -65,6 +62,12 @@ napi_value Init(napi_env env, napi_value exports) {
|
|
|
65
62
|
|
|
66
63
|
#endif
|
|
67
64
|
|
|
65
|
+
napi_status status = napi_get_uv_event_loop(env, &thread_loop);
|
|
66
|
+
if (status != napi_ok) {
|
|
67
|
+
ZITI_NODEJS_LOG(ERROR, "napi_get_uv_event_loop failed, status: %d", status);
|
|
68
|
+
abort();
|
|
69
|
+
}
|
|
70
|
+
|
|
68
71
|
// Expose some Ziti SDK functions to JavaScript
|
|
69
72
|
expose_ziti_close(env, exports);
|
|
70
73
|
expose_ziti_dial(env, exports);
|
package/src/ziti_init.c
CHANGED
|
@@ -17,11 +17,6 @@ limitations under the License.
|
|
|
17
17
|
#include "ziti-nodejs.h"
|
|
18
18
|
|
|
19
19
|
ziti_context ztx = NULL;
|
|
20
|
-
uv_loop_t *loop = NULL;
|
|
21
|
-
|
|
22
|
-
uv_thread_t thread;
|
|
23
|
-
uv_async_t async;
|
|
24
|
-
|
|
25
20
|
|
|
26
21
|
typedef struct {
|
|
27
22
|
napi_async_work work;
|
|
@@ -185,16 +180,6 @@ static void on_ziti_event(ziti_context _ztx, const ziti_event_t *event) {
|
|
|
185
180
|
}
|
|
186
181
|
|
|
187
182
|
|
|
188
|
-
|
|
189
|
-
static void child_thread(void *data){
|
|
190
|
-
uv_loop_t *thread_loop = (uv_loop_t *) data;
|
|
191
|
-
|
|
192
|
-
//Start this loop
|
|
193
|
-
uv_run(thread_loop, UV_RUN_DEFAULT);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
static void consumer_notify(uv_async_t *handle, int status) { }
|
|
197
|
-
|
|
198
183
|
/**
|
|
199
184
|
*
|
|
200
185
|
*/
|
|
@@ -267,13 +252,6 @@ napi_value _ziti_init(napi_env env, const napi_callback_info info) {
|
|
|
267
252
|
napi_throw_error(env, NULL, "Failed to napi_create_threadsafe_function");
|
|
268
253
|
}
|
|
269
254
|
|
|
270
|
-
// Create and set up the consumer thread
|
|
271
|
-
if (NULL == thread_loop) { // Spawn the loop only once
|
|
272
|
-
thread_loop = uv_loop_new();
|
|
273
|
-
uv_async_init(thread_loop, &async, (uv_async_cb)consumer_notify);
|
|
274
|
-
uv_thread_create(&thread, (uv_thread_cb)child_thread, thread_loop);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
255
|
// Light this candle!
|
|
278
256
|
ziti_options *opts = calloc(1, sizeof(ziti_options));
|
|
279
257
|
|