Пример #1
0
void QDnsLookupRunnable::run()
{
    QDnsLookupReply reply;

    // Validate input.
    if (requestName.isEmpty()) {
        reply.error = QDnsLookup::InvalidRequestError;
        reply.errorString = tr("Invalid domain name");
        emit finished(reply);
        return;
    }

    // Perform request.
    query(requestType, requestName, nameserver, &reply);

    // Sort results.
    if (!theDnsLookupSeedStorage()->hasLocalData()) {
        qsrand(QTime(0,0,0).msecsTo(QTime::currentTime()) ^ reinterpret_cast<quintptr>(this));
        theDnsLookupSeedStorage()->setLocalData(new bool(true));
    }
    qt_qdnsmailexchangerecord_sort(reply.mailExchangeRecords);
    qt_qdnsservicerecord_sort(reply.serviceRecords);

    emit finished(reply);
}
Пример #2
0
void QDnsLookupRunnable::run()
{
    QDnsLookupReply reply;

    // Validate input.
    if (requestName.isEmpty()) {
        reply.error = QDnsLookup::InvalidRequestError;
        reply.errorString = tr("Invalid domain name");
        emit finished(reply);
        return;
    }

    // Perform request.
    query(requestType, requestName, nameserver, &reply);

    // Sort results.
    qt_qdnsmailexchangerecord_sort(reply.mailExchangeRecords);
    qt_qdnsservicerecord_sort(reply.serviceRecords);

    emit finished(reply);
}