- return toResult(client->request(type, toString(userName), toString(password), fromSTGPairs(pairs)));
+ 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);