diff --git a/build_num b/build_num index 4c2d46832..75aee55bf 100644 --- a/build_num +++ b/build_num @@ -1 +1 @@ -#define BUILD_NUM 372 +#define BUILD_NUM 374 diff --git a/src/gui/utils.cpp b/src/gui/utils.cpp index 268f32889..dae402b41 100644 --- a/src/gui/utils.cpp +++ b/src/gui/utils.cpp @@ -399,13 +399,33 @@ 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 results; try { - list results = DNS::getHostByName( - name.toAscii().data(), af_type); - return QString(results.front().toString().c_str()); - } catch (FWException&) + results = DNS::getHostByName(name.toAscii().constData(), af_type); + } catch (FWException &e) { + if (fwbdebug) + qDebug("DNS::getAddrByName: DNS lookup error: %s", e.toString()); + return ""; + } + + if (fwbdebug) + { + qDebug("DNS::getAddrByName: got %d addresses", results.size()); + } + + try + { + if (results.size()>0) + return QString(results.front().toString().c_str()); + } catch (FWException &e) + { + qDebug("DNS::getAddrByName: Can not convert address to string"); } return "";