I guess I don't see the usefulness of the protocol independence, as
the term is being applied here.  Wget is not protocol-independent, it
uses TCP and depends on it in various places of the code.

The only advantage is arguably clearer code in functions like
`lookup_host', but even that does not come without a price.  For one,
you rely on a replacement implementation of getaddrinfo on older
systems.  The current code does not -- it just uses gethostbyname
directly where available; in fact, it has its own data structures
which can been filled from any source, either from getaddrinfo or from
the vector which gethostbyname returns (and which can be easily
synthesized if the addresses are coming from another source).

The other change is to pass instances of `struct sockaddr_storage'
instead of just the addresses.  I don't find that elegant at all.
sockaddr can and does carry unnecessary baggage -- such as the port
number -- which is not really part of the host's address in the sense
that Wget uses it.  The current code is storing the address and the
address only.

The main idea behind protocol-independent programming is to call
`connect' with the sockaddr pointer returned by getaddrinfo.  But Wget
does not do that anyway, so what's the gain?  Do you have a specific
problem with the current CVS code that you're trying to solve?

Reply via email to