chiark / gitweb /
Turn query domain parsing upside-down.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 21 May 2014 00:21:58 +0000 (01:21 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 21 May 2014 00:21:58 +0000 (01:21 +0100)
commit3540caec6116f7c66d43cabec178d5e622a10f76
treecb7befa3c68d84691f76df922ef1415ffd99e971
parente35d8cca241a9c6397c32ba42e7dbb045887c2e7
Turn query domain parsing upside-down.

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.
src/internal.h
src/query.c
src/transmit.c
src/types.c