[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: [PATCH] DNS cache for Konqueror/KIO
From:       Thiago Macieira <thiago () kde ! org>
Date:       2008-07-01 23:48:36
Message-ID: 200807012048.37066.thiago () kde ! org
[Download RAW message or body]

[Attachment #2 (text/plain)]

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

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic