[Development] API review for a new QDnsResolver class
Peter Hartmann
peter.hartmann at nokia.com
Fri Nov 4 11:47:23 CET 2011
On 11/04/2011 11:05 AM, ext Thiago Macieira wrote:
> On Friday, 4 de November de 2011 10:36:29 Peter Hartmann wrote:
>> I am happy with having one QDnsReply class; I think we can get pretty
>> far with some special accessors for SRV and other records, and one
>> generic accessor for simple (QString) and unsupported cases. Then
>> whoever wants to read a currently unsupported response format needs to
>> parse the response string himself, which IMO is not that bad.
>> We can then in the future extend the class with more special accessors
>> if need be.
>
> There's no way to provide the unsupported formats in QString. It would need to
> be QByteArray and, even then, it's useless if it contains a compressed domain
> name.
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.
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.
>
>
>
>
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
--
Qt Developer Days 2011 – REGISTER NOW!
October 24 – 26, Munich
November 29 – December 1, San Francisco
Learn more and Register at http://qt.nokia.com/qtdevdays2011
More information about the Development
mailing list