On Monday 26 January 2004 13:32, Hrvoje Niksic wrote:
> 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?

although i am a *strong* supporter of protocol-independent programming, i 
cannot but completely agree with hrvoje here.

-- 
Aequam memento rebus in arduis servare mentem...

Mauro Tortonesi                 [EMAIL PROTECTED]
                                [EMAIL PROTECTED]
                                [EMAIL PROTECTED]
Deep Space 6 - IPv6 with Linux  http://www.deepspace6.net
Ferrara Linux User Group        http://www.ferrara.linux.it



Reply via email to