redding/sanford — pull request #114 by jcredding (2014-06-18 20:03:43+00:00)
Title: Add `Server::ConfigData`, make `HostData` compatible

This adds `ConfigData` to the `Server`, which replaces part of the
role that `HostData` currently handles. `HostData` is the
"compiled" data from a `Host`. Similarly, `ConfigData` is the
"compiled" data from the server's `Configuration`. This is done
for speed because `NsOptions` is relatively (when 1-5ms matters)
slow in reading options.

The `ConfigData` is built when the `Server` is initialized and is
seeded by the `Configuration` data. It also handles looking up
routes given a name. The `Server` will use this to find the service
handler it needs to run for a request.

`ConfigData` will also be used by the `ErrorHandler` when an
error occurs. To handle `Sanford` currently using the `HostData`
but needing the `ErrorHandler` to also work with `ConfigData`, I
made their interfaces mostly compatible. This allows updating
the `ErrorHandler` to use `ConfigData` but not breaking the build
which uses the `HostData`. In this case, I didn't want to create
two error handlers, one that worked with `ConfigData` and one
that worked with `HostData`.

All of this is setup for switching out the old server for the new
one.

@kellyredding - Ready for review.