+ void Timeout()
+ {
+ if (last_timeout_check == ServerInstance->Time())
+ return;
+ last_timeout_check = ServerInstance->Time();
+
+ for (query_queue::iterator it = this->queries.begin(); it != this->queries.end(); )
+ {
+ LDAPQuery msgid = it->first;
+ time_t created = it->second.first;
+ LDAPInterface* i = it->second.second;
+ ++it;
+
+ if (ServerInstance->Time() > created + timeout)
+ {
+ LDAPResult* ldap_result = new LDAPResult();
+ ldap_result->id = msgid;
+ ldap_result->error = "Query timed out";
+
+ this->queries.erase(msgid);
+ this->results.push_back(std::make_pair(i, ldap_result));
+
+ this->NotifyParent();
+ }
+ }
+ }
+