windows udp sockets return WSAEINVAL if recvfrom_nonblock is called when
unbounded, ie. when not bound to an address in listener mode, nor before
actually sending data, which is our case.
This fix works the same way as HTTP connections, i.e. by avoiding
read/write operations when there's no need. This can also give us some
performance.
Fixes#36
this was causing some unfortunate loops around the tcp connect, and
judging by the history, it's solving an issue related to the https
resolver, which has changed and stabilized significantly.
while adding tests, found out that io as hash of authority => io wasn't
working due to missing uri extensions. Made sure the same works for unix
sockets.
(This deprecates the :transport_options option)
This should be given an array of peer addresses to connect to. It can be
used when the destination IPs are known and you want to avoid resolving
them, and when the destination is a unix socket (and the destination is
a FS path)
connections which either already contain addresses, or were given an
open IO object, should be marked as resolved, and should not go through
the resolver.
session
In order not to leak these into other sessions, one keeps a registry
around as a session option. This will cascade into the request and
response encoding routines.
this is achieved by a rework of the upgrade plugin, and the addition of
an h2 upgrade plugin. The idea is the following: if a response carries
an Upgrade header, and there's a handler for it, we should go for it.
The difference is:
* when the response is 101, this means that the negotiation must take
place before the actual response comes in;
* when the response is 200, upgrading means reconnecting to the channel,
and assume the new protocol for subsequent requests only.
connection
After the connection has been upgraded and session is kept open,
subsequent requests were still trying to upgrade it. This fixes it by
marking the connection as upgraded, and falling back to normal
behaviour when it is.
By setting the h2c protocol handler, the rest became much simpler.
Formatting the upgrade request is a matter for the sub-plugin.
Therefore, the specific h2c request upgrade headers are built-in there.