This commit is contained in:
SVN User
2008-07-17 21:16:56 +00:00
parent 5cb511f025
commit cfcdeac742
2 changed files with 17 additions and 13 deletions
+1 -1
View File
@@ -1 +1 @@
#define BUILD_NUM 374
#define BUILD_NUM -1
+16 -12
View File
@@ -399,33 +399,37 @@ void setDisabledPalette(QWidget *w)
QString getAddrByName(const QString &name, int af_type)
{
if (fwbdebug)
qDebug("DNS::getAddrByName: start lookup for %s, af %d",
name.toAscii().constData(), af_type);
list<InetAddr> results;
try
{
results = DNS::getHostByName(name.toAscii().constData(), af_type);
if (fwbdebug) qDebug("utils::getAddrByName: obtained %d addresses",
results.size());
} catch (FWException &e)
{
if (fwbdebug)
qDebug("DNS::getAddrByName: DNS lookup error: %s", e.toString());
if (fwbdebug) qDebug("utils::getAddrByName: DNS lookup error: %s",
e.toString().c_str());
return "";
}
if (fwbdebug)
{
qDebug("DNS::getAddrByName: got %d addresses", results.size());
}
try
{
if (results.size()>0)
{
list<InetAddr>::iterator i;
for (i=results.begin(); i!=results.end(); ++i)
{
qDebug("Result: af_type=%d result->isV6()=%d result->addr=%s",
af_type,
i->isV6(),
i->toString().c_str());
}
return QString(results.front().toString().c_str());
}
} catch (FWException &e)
{
qDebug("DNS::getAddrByName: Can not convert address to string");
qDebug("utils::getAddrByName: Can not convert address to string");
qDebug(e.toString().c_str());
}
return "";