VarValue Call(RCString method, const vector<VarValue>& params = vector<VarValue>()) { Ext::WebClient wc = GetWebClient(); wc.Proxy = nullptr; //!!!? wc.CacheLevel = RequestCacheLevel::BypassCache; wc.Credentials.UserName = !Login.empty() ? Login : RpcUrl.UserName; wc.Credentials.Password = !Password.empty() ? Password : RpcUrl.Password; String sjson; try { DBG_LOCAL_IGNORE_CONDITION_OBJ(error_condition(500, http_category())); sjson = wc.UploadString(RpcUrl.ToString(), JsonRpc.Request(method, params)); } catch (WebException& ex) { if (ex.code() == http_error::unauthorized) throw; sjson = ex.Result; } #ifdef X_DEBUG//!!!D cout << sjson << endl; #endif EXT_LOCKED(MtxHeaders, Headers = wc.get_ResponseHeaders()); /*!!!R XStratum = h.Get("X-Stratum"); XSwitchTo = h.Get("X-Switch-To"); XHostList = h.Get("X-Host-List");*/ return JsonRpc.ProcessResponse(ParseJson(sjson)); }
void Rollback() override { EXT_LOCKED(MtxSqlite, m_db.Rollback()); }
void Commit() override { EXT_LOCKED(MtxSqlite, m_cmdCommit.ExecuteNonQuery()); }
void BeginTransaction() override { EXT_LOCKED(MtxSqlite, m_cmdBeginExclusive.ExecuteNonQuery()); // EXT_LOCKED(MtxSqlite, m_db.BeginTransaction()); }