Only initialize evdns if DNS lookups are actually required by the loaded
proxy specifications. This allows sslsplit to work in non-DNS modes in
situations where the local DNS resolver does not work, such as for local
use on a system without network connectivity. Currently, only SNI based
proxy specs require DNS. On systems without network connectivity, DNS
subsystem init may fail due to /etc/resolv.conf being (temporarily)
unavailable.
Issue: #104
- Update copyright to 2015
- Remove the non-standard "unmodified" from the 2-clause BSD license
- Remove scalable from the tagline to avoid misinterpretations
For some error conditions, the error handler depends on
ctx->thr[idx]->dnsbase to be zeroed expicitly after allocation.
To prevent this type of error, zero all allocated memory even
though it will get written to in any case.
This should fix the segmentation fault in issue #10 but not the
underlying reason why the thread manager fails to start in the first
place.
Issue: #10
Reported by: linuxton
Yield the CPU in the main thread until the proxy thread manager is fully
started. Otherwise, the main thread could free the proxy thread manager
while the threads are still starting up, leading to a deadlock.