X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/5e4900a6f10a184153e12266db4d46a695d62b49..892d3409f087a2dfb3daafdd5873114c400127a8:/projects/rlm_stg/stg_client.cpp diff --git a/projects/rlm_stg/stg_client.cpp b/projects/rlm_stg/stg_client.cpp index 75109511..e34c50cd 100644 --- a/projects/rlm_stg/stg_client.cpp +++ b/projects/rlm_stg/stg_client.cpp @@ -42,7 +42,7 @@ Client* stgClient = NULL; class Client::Impl { public: - Impl(const std::string& address); + explicit Impl(const std::string& address); ~Impl(); bool stop() { return m_conn ? m_conn->stop() : true; } @@ -57,14 +57,12 @@ class Client::Impl pthread_cond_t m_cond; bool m_done; RESULT m_result; - bool m_status; - static bool callback(void* data, const RESULT& result, bool status) + static bool callback(void* data, const RESULT& result) { Impl& impl = *static_cast(data); STG_LOCKER lock(impl.m_mutex); impl.m_result = result; - impl.m_status = status; impl.m_done = true; pthread_cond_signal(&impl.m_cond); return true; @@ -109,7 +107,7 @@ RESULT Client::Impl::request(REQUEST_TYPE type, const std::string& userName, con int res = 0; while (!m_done && res == 0) res = pthread_cond_timedwait(&m_cond, &m_mutex, &ts); - if (res != 0 || !m_status) + if (res != 0) throw Conn::Error("Request failed."); return m_result; }