cherokee / webserver

Cherokee Web Server
GNU General Public License v2.0
568 stars 104 forks source link

Handle multiple results from getaddrinfo in different families #1236

Closed skinkie closed 5 years ago

skinkie commented 5 years ago

This commit changes something fundamental in the proxy handling. Previously the proxy was iterating over multiple possible IP addresses received from the source definition. The issue #1226 shows that this fails when mixing IPv4 and IPv6 results. This could be resolved by just taking the "right" addrinfo result, but this is executed after the socket has been created, hence: if we would have an IPv6 result, but created an IPv4 socket, we would miss all checks that happen upon socket creation.

The iteration over the getaddrinfo results has now been pulled into the proxy specific code, this might still be able to be abstracted.