Github user rgs1 commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/522#discussion_r189469556
--- Diff: src/c/src/zookeeper.c ---
@@ -4056,22 +4075,33 @@ int zoo_aremove_watchers(zhandle_t *zh, const char *path, ZooWatcherType
wtype,
oa = create_buffer_oarchive();
rc = serialize_RequestHeader(oa, "header", &h);
- rc = rc < 0 ? rc : serialize_RemoveWatchesRequest(oa, "req", &req);
- if (rc < 0) {
+
+ if (all) {
+ req.remove.path = (char*)server_path;
+ req.remove.type = wtype;
+ rc = rc < 0 ? rc : serialize_RemoveWatchesRequest(oa, "req", &req.remove);
+ } else {
+ req.check.path = (char*)server_path;
+ req.check.type = wtype;
+ rc = rc < 0 ? rc : serialize_CheckWatchesRequest(oa, "req", &req.check);
+ }
+
+ if (rc < 0) {
--- End diff --
ditto
---
|