Signed-off-by: Tao He <sighingnow@gmail.com>
This commit is contained in:
Tao He 2023-03-05 21:29:07 +08:00
parent 069f557151
commit b9e5933851
1 changed files with 9 additions and 3 deletions

View File

@ -98,11 +98,17 @@ void etcdv3::AsyncWatchAction::waitForResponse()
std::cerr << "WARN: The response hasn't been fully received and parsed" << std::endl;
}
std::cout << "issue a watch cancel" << std::endl;
// cancel the watcher after receiving the good response
this->CancelWatch();
continue;
}
// otherwise, start next round read-reply
// start the next round to read finish messages, read into "&dummy"
// (use nullptr, as it won't be touched).
stream->Read(nullptr, (void*)etcdv3::WATCH_FINISH);
} else {
// start the next round to read reply, read into "&reply"
stream->Read(&reply, (void*)this);
}
continue;
}
if(isCancelled.load()) {