+ RadLog("Client is not configured.");
+ return emptyResult();
+ }
+ try {
+ if (!client->connected())
+ {
+ if (!STG_CLIENT::reconnect())
+ return emptyResult();
+ client = STG_CLIENT::get();
+ }
+ response.done = false;
+ client->request(type, toString(userName), toString(password), fromSTGPairs(pairs));
+ pthread_mutex_lock(&response.mutex);
+ while (!response.done)
+ pthread_cond_wait(&response.cond, &response.mutex);
+ pthread_mutex_unlock(&response.mutex);
+ if (!response.status)
+ return emptyResult();
+ return toResult(response.result);
+ } catch (const STG_CLIENT::Error& ex) {
+ RadLog("Error: '%s'.", ex.what());
+ return emptyResult();