Make current loglevel and current log callback global
to the library. Attaching them to the nsock pool doesn't
bring any benefit and prevents from logging activity in
code sections that don't have access to a pool (such as
proxy chain specification parsing).
Updated external calls and nsock tests accordingly.
This prevents nsock from iterating over the whole list of events at
each runloop, thus improving performance.
It made it necessary to have pointers from the msevents to the event
lists they belong to. The patch therefore also changes gh_list from
autonomous containers to embedded structures.
Added unit tests accordingly and cosmetic changes to make things look
more consistent.
This simplifies the interface that proxies export to the library but also relies
upon the assumption that a proxy chain starts with a TCP connection from the
scanner to the next hop proxy. That will be enough ATM.
When establishing the tunnel through proxy chain, we need to track status of
each proxy (storing R/W buffers, stats, retries...).
This patch lets proxies store and manage whatever structure they want to have
for this in a Nsock IOD. Since types can differ between proxy types, the
proxy_info are stored as a list of void *, ordered like the proxy nodes.
Proxy backends are selected at runtime. Each proxy exports a list of operations
to the rest of the library. This is similar to the way IO engines are
implemented within nsock.