Some plugins override the Session class, however there may be instances
of the original Session around, therefore the assertions need to somehow
point to the original Session class to stil be able to work.
Closes#247
when closed, connections are now placed in a place called eden_connections; whenever a connection is matched for, after checking the live connections and finding none, a match is looked in eden connections; the match is accepted **if** the IP is considered fresh (the input is validated in the cache, or input was an ip or in /etc/hosts, or it's an external socket) and, if a TLS connection, the stored TLS session did not expire; if these conditions do not match, the connection is dropped from the eden and a new connection will started instead; this will therefore allow reusing ruby objects, reusing TLS sessions, and still respect the DNs cache
when connections get reset due to max number of requests being reached,
the same TLS session is going to be reused, as long as it's valid.
This change is ported from the same feature in net-http, including [the
tls 1.3
improvements](ddf5c52b5f)
besides not setting session sni hostname, which it was already doing,
the verify_hostname is set to false to avoid warnings, and the
post_connection_check is still allowed to proceed, to check that the
certificate returned includes the IP address.
port of the similar net-http change found
[here](fa68e64bee)
also ommitting certain steps in the initializer if the ssl socket is
initiated outside of the httpx context and passed as an option.
* implement `Faraday::Adapter#build_connection´ (adapter seems to
expect it)
* implement `Faraday::Adapter#close` (adapter seems to expect it)
* use `Faraday::Adapter#request_timeout` to translate faraday timeouts
to httpx timeouts;
* ensure that the same HTTPX sesion object gets reused
In the process, also had to tweak the parallel manager, by
reimplementing the faraday APIs I was required to implement in the first
place, in order to obe able to reuse something (which just shows that
this faraday parallel API was poorly thought out).