RFC: Drop notice: KNetwork
Thiago Macieira
thiago at kde.org
Thu Mar 1 09:49:21 GMT 2007
Andreas Aardal Hanssen wrote:
>On Wednesday 28 February 2007 22:35, Thiago Macieira wrote:
>> They've been doing that for 12 years. Most programs in existence have
>> the same problem.
>
>QHostInfo uses gethostbyname(), which immediately adopts to changes
>in /etc/resolv.conf.
I don't think it does. That's exactly why the res_init call was added over
6 years ago:
http://websvn.kde.org/trunk/kdelibs/kdecore/ksock.cpp?r1=67383&r2=74518&pathrev=80000
and again 5 years and 10 months ago:
http://websvn.kde.org/trunk/kdelibs/kdecore/kextsock.cpp?r1=89941&r2=90662&pathrev=100000
and again 3 years and 10 months ago:
http://websvn.kde.org/trunk/kdenonbeta/libqt-addon/libqt-addon/qresolvermanager.cpp?r1=227678&r2=227815&pathrev=275000
Every time we redesign the socket API, we forget about this and then have
to come back and add it.
I've taken a look at QHostInfo code and I know why it appears to work:
it's threaded. And on Linux/glibc, the resolver status is kept
per-thread. So every time the thread dies and starts again, res_init is
automatically called by glibc itself.
This will not translate to other systems. Will we have to?
--
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: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070301/1d626275/attachment.sig>
More information about the kde-core-devel
mailing list