TheTorProject/libight — pull request #53 by bassosimone (2014-12-11 01:09:57+00:00)
Title: Make DNS code easier to use

1) Stop passing a `resolver` string to Request() constructor which was confusing.

2) Bind a resolver to its requests, so that you don't need anymore to keep track of requests constructed using a resolver to prevent them from being deleted. Now, all the requests constructed using a resolver are pending until either they receive a response (possibly an error) or the resolver is destroyed.

3) In the vein of 1, stop passing around all unused values (simplifies code!).

4) Other, minor things, including a unit test that also works on valgrind on slow machines.

Valgrind agree (to the extent touched by the unit test, which is already quite thorough) that the new code does not introduce new memory errors.