| 112 | } |
| 113 | |
| 114 | void DNSThread::processResult |
| 115 | ( |
| 116 | ) |
| 117 | { |
| 118 | string result; |
| 119 | DNSLookup *lookup; |
| 120 | { |
| 121 | LockGuard LG(m_dnsMutex); |
| 122 | lookup = m_dnslist.front(); |
| 123 | m_dnslist.pop_front(); |
| 124 | if (m_dnslist.empty()) |
| 125 | m_dnsRequestEvent->Reset(); |
| 126 | } |
| 127 | Log::Write(LogLevel_Info, "LookupTxT Checking %s", lookup->lookup.c_str()); |
| 128 | if (!m_dnsresolver.LookupTxT(lookup->lookup, lookup->result)) { |
| 129 | Log::Write(LogLevel_Warning, "Lookup on %s Failed", lookup->lookup.c_str()); |
| 130 | } else { |
| 131 | Log::Write(LogLevel_Info, "Lookup for %s returned %s", lookup->lookup.c_str(), lookup->result.c_str()); |
| 132 | } |
| 133 | lookup->status = m_dnsresolver.status; |
| 134 | |
| 135 | /* send the response back to the Driver for processing */ |
| 136 | Driver::EventMsg *event = new Driver::EventMsg(); |
| 137 | event->type = Driver::EventMsg::Event_DNS; |
| 138 | event->event.lookup = lookup; |
| 139 | this->m_driver->SubmitEventMsg(event); |
| 140 | |
| 141 | |
| 142 | } |
| 143 | |
| 144 | |