[PATCH] DNS cache for Konqueror/KIO

Thiago Macieira thiago at kde.org
Wed Jul 2 00:48:36 BST 2008


Thiago Macieira wrote:
>        QTime timer;
>        timer.start();
>        while (it.hasNext()) {
>                d->socket.connectToHost(it.next(), port);
>                int timeout = -1;
>                if (d->timeout > -1)
>                        timeout = d->timeout - timer.elapsed();
>                if (!d->socket.waitForConnected(timeout))
>                        break;
>        }

Hmm... if timeout becomes negative (i.e., timer.elapsed() > d->timeout for 
d->timeout != -1), you should also break out of the loop and provide a 
connection error condition.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080701/2b27d631/attachment.sig>


More information about the kde-core-devel mailing list