chiark / gitweb /
src/: Change how query domain names are checked.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 31 May 2014 16:26:34 +0000 (17:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 13 Jun 2014 08:57:41 +0000 (09:57 +0100)
commite8e5aeacbdaf5654974626d548f30a4c86e5ced6
treeb9ff9bc368c3f43ebd6518b1c74b18c736aa79f0
parentbe4d66dc60264126ba6b3fbd67609ef0b6c0d266
src/: Change how query domain names are checked.

The `qdparselabel' hook is no more.  Unescaping of the query domain is
now done in one place, and always in the same way.  Checking of the
domain name is done through a new `checklabel' hook, with a more
convenient interface.

The checklabel hook does not have the original possibly-escaped version
of the query domain available to it; it can only check the name being
submitted on the wire, not the form in which it was provided to the
library.  This eliminates the inconsistency in SRV record handling,
where

\095http._tcp.distorted.org.uk

is acceptable, but

_\104ttp._tcp.distorted.org.uk

is not.  It also now prohibits SRV queries on `_wrong', which I think
was always intended but didn't actually work.

All queries are checked, including internally generated ones, so this
can be used to store information about the query domain for later use,
so we let the hook store information in the qcontext structure.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
src/internal.h
src/query.c
src/transmit.c
src/types.c