Skip to content

Commit a218abe

Browse files
authored
fix(addOn): check state before executing underlying client instance functions (#338)
* fix(addOn): check state before executing underlying client instance functions * docs(prebuild instructions): change outdated text * add Node.js 20 prebuild for Mac OS X M1 * add Node.js 18 prebuild for Mac OS X M1 * add Node.js 18 prebuild for Mac OS X x86 * add Node.js 20 prebuild for Mac OS X x86 * add prebuilds for Windows
1 parent d865155 commit a218abe

File tree

8 files changed

+5
-6
lines changed

8 files changed

+5
-6
lines changed

prebuilds/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
### Prebuilds
22

33
Currently, there are prebuilt Node.js AddOns for Mac OS X and Windows.
4-
Each platform has prebuilds for Node.js 12 and 14.
54

65

76
#### Creating prebuilds
87
Create prebuilds for Mac OS X:
98

109
```bash
11-
npx prebuildify --arch x64 --platform darwin --target 20.10.0
10+
npx prebuildify --arch x64 --platform darwin --target 20.11.0
1211
```
1312

14-
Prebuilds for Mac OS X with the M1 processor:
13+
Prebuilds for Mac OS X with the M1/M2/M3 processor:
1514
```bash
16-
npx prebuildify --arch arm64 --platform darwin --target 20.10.0
15+
npx prebuildify --arch arm64 --platform darwin --target 20.11.0
1716
```
1817

1918
Create prebuilds for Windows:
2019

2120
```bash
22-
npx prebuildify --arch x64 --platform win32 --target 20.10.0
21+
npx prebuildify --arch x64 --platform win32 --target 20.11.0
2322
```
-16.2 KB
Binary file not shown.
0 Bytes
Binary file not shown.

prebuilds/darwin-x64/node.abi108.node

-16.1 KB
Binary file not shown.

prebuilds/darwin-x64/node.abi115.node

0 Bytes
Binary file not shown.

prebuilds/win32-x64/node.abi108.node

512 Bytes
Binary file not shown.

prebuilds/win32-x64/node.abi115.node

512 Bytes
Binary file not shown.

src/node-zk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ class ZooKeeper: public Nan::ObjectWrap {
609609
Nan::SetPrivate(cb->GetFunction(), Nan::New(PRIVATE_PROP_ZK), zk->handle()); \
610610

611611
#define METHOD_EPILOG(call) \
612-
int ret = (call); \
612+
int ret = (zk->zhandle ? (call) : ZINVALIDSTATE); \
613613
RETURN_VALUE(info, Nan::New<Int32>(ret))
614614

615615
#define WATCHER_PROLOG(info) \

0 commit comments

Comments
 (0)