[Development] API review for a new QDnsResolver class

Thiago Macieira thiago.macieira at intel.com
Fri Nov 4 12:12:18 CET 2011


On Friday, 4 de November de 2011 11:47:23 Peter Hartmann wrote:
> True, QByteArray then, but why would it be useless? You would just need 
> to parse the response itself if the format is not supported, which would 
> be easy for TXT, SOA, A6 etc. For CERT and other DNSSEC types you would 
> have to do the parsing yourself (e.g. create a PGP key from the raw 
> data), but at least it would be possible.

I'm thinking of compressed domain names, but now my DNS-fu fails me. Does it 
contain back-references to previously-used names?

IIRC, you need to parse the full reply and keep a list of used DNS labels in 
order to reconstruct the domain name. Since this API would not give access to 
the full listing, some record types may be unparsable.

I'd much rather simply say we don't support other types.

> Btw. I think we need the generic accessor anyway because you never know 
> what the format of a TXT response looks like. Q3Dns allowed that only 
> for TXT records, but IMO it would be better to always have an accessor 
> to the raw response data, or at least if the query type is unknown.

That's a good point: we don't know what encoding the text data is in. So 
QByteArray it is.

QString is reserved for domain names themselves (because of IDN).

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20111104/f554743f/attachment.sig>


More information about the Development mailing list