On Thu, Sep 1, 2011 at 18:36, Nick Mathewson <ni...@freehaven.net> wrote: > When you say > + if ((flags & 0x020f) && (flags & 0x020f) != DNS_ERR_NOTEXIST) { > + /* there was an error and it's not NXDOMAIN */ > > I don't see how (flags & 0x020f) != DNS_ERR_NOTEXIST could ever be > false. DNS_ERR_NOTEXIST is 3, and (flags & 0x020f) is either 0x020f > or 0. > > Am I missing something, or did you mean to check something else here?
Hi Nick, (flags & 0x20F) is not either 0x020F or 0, it can easily be 0x200, for example, for truncated OK message. "&" is binary "and", not logic "and". Logic "and" is "&&". So (flags & 0x020f == DNS_ERR_NOTEXIST) is true only for non-truncated answer with code 3 (NXDOMAIN) - that's the only error answer I want to parse looking for SOA record. Am I missing anything? -- WBRBW, Leonid Evdokimov xmpp:l...@darkk.net.ru && http://darkk.net.ru tel:+79816800702 && tel:+79050965222 *********************************************************************** To unsubscribe, send an e-mail to majord...@freehaven.net with unsubscribe libevent-users in the body.