Gé Weijers writes:
> On Mon, 3 Oct 2011, Konstantin Khomoutov wrote: >> Is there no way to make it switchable at runtime (like via `fossil set >> ipv6 on`) or is it doable but just complicated to implement? >> Having a compile-time switch effectively doubles the number of binaries >> one have to built to offer for downloading. The same issue arises for >> downstream distro packagers. > It's doable and not that complicated. The patch submitted is much more > complicated than it needs to be, esp. on the server side. Thanks for the time to review the code. Assuming good support for IPv6 in major Unixen, I decided not to do any runtime magic. > All this #ifdef stuff is not necessary. Looking at the patch I saw several > issues: > - not using 'struct sockaddr_storage' but casting a char[256] to a struct > sockaddr pointer (alignment) > - using an overly complicated method to get a representation of the IP > address (use 'getnameinfo' in stead) > It is not necessary to even specify the protocol, unless you want to > force the use of IPv4 or IPv6. The complexity is hidden in the library > routines > 'getnameinfo' and 'getaddrinfo'. I wasn't aware of both sockaddr_storage, and getnameinfo(). They seem good to me, and I've updated diff[1] to use them. References: [1] http://people.freebsd.org/~ashish/fossil-ipv6-rev-proxy.diff HTH -- Ashish SHUKLA “Well, I guess cyborgs like myself have a tendency to be paranoid about our origins.” (Motoko Kusanagi in movie "Ghost in the Shell")
pgpXPbDG02YHv.pgp
Description: PGP signature
_______________________________________________ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users