-bool InspSocket::DoResolve()
-{
- log(DEBUG,"In DoResolve(), trying to resolve IP");
- if (this->dns.HasResult())
- {
- log(DEBUG,"Socket has result");
- std::string res_ip = dns.GetResultIP();
- if (res_ip != "")
- {
- log(DEBUG,"Socket result set to %s",res_ip.c_str());
- strlcpy(this->IP,res_ip.c_str(),MAXBUF);
- socket_ref[this->fd] = NULL;
- }
- else
- {
- log(DEBUG,"Socket DNS failure");
- this->Close();
- this->state = I_ERROR;
- this->OnError(I_ERR_RESOLVE);
- this->fd = -1;
- this->ClosePending = true;
- return false;
- }
- return this->DoConnect();
- }
- log(DEBUG,"No result for socket yet!");
- return true;
-}
-