Move libevent 1.x headers to include/, to put all public headers in one place.
Merge in a punctuation fix from upstream tinytest
Synchronize with upstream tinytest
Invert the sense and the name of HT_CACHE_HASH_VALUES

This is meant to make it easier to merge ht-internal.h back upstream
into Tor.
Port changes from Tor for ht-internal.h
Fix up usage of reserved identifiers in ht-internal.h
If open(O_CLOEXEC) fails, fall back to fcntl(CLOEXEC)

This is needed for folks who build with recent Linux kernel headers
but run with older kernels.
Added OPENSSL_LDFLAGS env variable which is appended to SSL checks.

If openssl is not installed system-wide or not compiled as a shared library,
some systems require various link flags (e.g., -ld).
Changed OPENSSL_LDFLAGS to OPENSSL_LIBADD
Merge remote-tracking branch 'origin/patches-2.0'

Conflicts:
	configure.in
Stop crashing in evdns when nameserver probes give a weird error

When a nameserver is down, we periodically try sending a "probe"
message to that nameserver to see if it has come back up.  If a
nameserver comes up, we cancel any pending probe messages.

Cancelling a probe message while handling the probe's response would
result in a access-after-free or a double-free, so when we notice that
we're about to call a nameserver up because of having received a probe
from it, we need to check whether current response is the response
from the probe.

There was a case where we didn't to that, though: when the resolver
gave us an unusual error response to our request that it resolve
google.com.  This is pretty rare, but apparently it can happen with
some weird cacheing nameservers -- the one on the mikrotik router, for
example.  Without this patch, we would crash with a NULL pointer
derefernce.

Thanks to Hannes Sowa for finding this issue and helping me track it
down.
Merge remote-tracking branch 'origin/patches-2.0'
Merge remote-tracking branch 'github/21_fast_syscalls'
Support TCP_DEFER_ACCEPT sockopts for listeners

A listening socket can be enabled with the sockopt
TCP_DEFER_ACCEPT. This informs the kernel to not call the user-land
accept() until real data has been written to the socket.

A new flag LEV_OPT_DEFERRED_ACCEPT has been introduced to
automatically set this option. Optionally
evutil_make_tcp_listen_socket_deferred() can be called manually.

(Tweaked slightly by nickm.)
Add another caveat to the TCP_DEFER_ACCEPT documentation
Start work on a 2.1 changelog and whats-new
Fix an "unused return value" warning on write() in signal handler
Refactor the functions that run over every event.

Now there are appropriate "for each event", "for each fd", and "for
each signal" helpers that they can use; this makes the code a bit
simpler, and far less duplicated.

This lets me turn back on the functions I disabled when removing
eventlist.

Additionally, check more lists for circularity in
event_base_assert_ok().

Add typedefs for the callback types.

Name fewer things "ctx".

Adds an implementation of Floyd's tortoise-and-hare algorithm to check
for circularity in TAILQs and LISTs, to avoid the abuse of flags that
event_base_assert_ok() was doing before.

Suggested by Dave Hart.
Add doxygen for event_base_dump_events
Merge branch '21_eventlist_v3_squashed'