summaryrefslogtreecommitdiffstats
path: root/configd/src/apps/sentinel/outward-check.h
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-06-02 12:05:14 +0000
committerArne Juul <arnej@verizonmedia.com>2021-06-02 12:05:14 +0000
commit2b1964dd62942c7d75920357454937e374331320 (patch)
tree6fdbb2bd6d31675faca6b88ed15495ba52dd4fcf /configd/src/apps/sentinel/outward-check.h
parent6a0ead14e709bf3ef93e75612b8f47ecab5cba66 (diff)
cleanup
Diffstat (limited to 'configd/src/apps/sentinel/outward-check.h')
-rw-r--r--configd/src/apps/sentinel/outward-check.h30
1 files changed, 23 insertions, 7 deletions
diff --git a/configd/src/apps/sentinel/outward-check.h b/configd/src/apps/sentinel/outward-check.h
index 8a0b036ac49..01a298aee18 100644
--- a/configd/src/apps/sentinel/outward-check.h
+++ b/configd/src/apps/sentinel/outward-check.h
@@ -10,21 +10,37 @@
namespace config::sentinel {
+struct OutwardCheckContext {
+ vespalib::CountDownLatch latch;
+ const char * myHostname;
+ int myPortnum;
+ FRT_Supervisor &orb;
+ OutwardCheckContext(size_t count,
+ const char * hostname,
+ int portnumber,
+ FRT_Supervisor &supervisor)
+ : latch(count),
+ myHostname(hostname),
+ myPortnum(portnumber),
+ orb(supervisor)
+ {}
+};
+
+enum class CcResult { UNKNOWN, CONN_FAIL, REVERSE_FAIL, REVERSE_UNAVAIL, ALL_OK };
+
class OutwardCheck : public FRT_IRequestWait {
private:
- bool _wasOk = false;
- bool _wasBad = false;
+ CcResult _result = CcResult::UNKNOWN;
FRT_Target *_target = nullptr;
FRT_RPCRequest *_req = nullptr;
std::string _spec;
- vespalib::CountDownLatch &_countDownLatch;
+ OutwardCheckContext &_context;
public:
- OutwardCheck(const std::string &spec, const char * myHostname, int myPortnum,
- FRT_Supervisor &orb, vespalib::CountDownLatch &latch);
+ OutwardCheck(const std::string &spec, OutwardCheckContext &context);
virtual ~OutwardCheck();
void RequestDone(FRT_RPCRequest *req) override;
- bool ok() const { return _wasOk; }
- bool bad() const { return _wasBad; }
+ bool ok() const { return _result == CcResult::ALL_OK; }
+ CcResult result() const { return _result; }
};
}