curl-library
Re: PATCH: Do not allow multi interface to block trying to perform DNS on interface names
Date: Thu, 3 Nov 2011 23:13:38 -0700
On Thu, Nov 03, 2011 at 11:10:43PM -0400, Jason Glasgow wrote:
> The following patch fixes a bug in which calling the multi-interfaces will
> block. The multi-interfaces should never block, but if you supply an interface
> name as an INTERFACE option and the interface disappears between when you
> created the request and when it starts executing, the code will erroneously
> treat the interface/device name as a name to look up via DNS. It then
> potentially calls Curl_resolver_wait_resolv(), which will block.
Another approach would be to look for a magic prefix on the interface name
and use that to specify the argument type. That also solves a related
(but likely less common) problem of how to force use of a domain name that
matches the name of an interface. e.g. "if!ppp0" would mean to use the
interface named ppp0 and not the domain name ppp0, while
"ip!ppp0" would mean to use the domain name ppp0 and not the interface ppp0.
Plain "ppp0" would operate as it does now, searching for an interface with
that name and trying to resolve it if no interface of that name is found.
This could also allow specifying the type of binding to use, e.g. "ip6!host"
would mean to bind to the IPv6 address returned by the DNS lookup on host.
This simplifies implementation as well, since existing mechanisms for
specifying an interface can be used instead of requiring applications to use
and support one (or more) new setopt option(s).
>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-11-04