> > > Tag: squid3-ipv6 > > config.h > > > > +#define NEEDS_BRACKETS(s) \ > > + SAFE_INET_ADDR(s,NULL) > > + > > Just curious, but what is the rationale behind this macro? > Okey.
The format of IPv6 URLs are sligthly modified . Since the dotted addresses can containg ":" character, it was to mandatory to support brackets to split the dotted host address from the port. i.e: This do not apply to the DNS names... http://124.35.46.45 http://124.35.46.45:9090 http://my.web.com http://2004:80:255f:3abb::3 http://[2004:80:25ab:fe33:5]:9090 See the next cvs logs to this mail to understand the rationale, and how this macro can contribute to readability... > Brobably also needs a better name... NEEDS_BRACKETS is pretty generic and > not obviously associated with networking. > Hmmm... Yes.. May be URL_NEEDS_BRACKETS ? Any suggestion ? > Another comment on general style: Try to avoid macros in C++ unless > absolute needed. Inlined functions generally serves the purpose just as > good in terms of performance and additionally is type safe and does not > pollute the name space as badly. > Yes. For the time beeing, up to the tests I'm not taking care of that. My ideas was rather to leave them as macros, yet not defined for IPv4... So when the branch becomes steady, it would be easier for the group to understand why the compilation fails, and try to merge into head in a scalable way... IPv6 branch is not an extension for Squid3, rather a deep change... Neither I do like the AF_FAMILY defines... We can discuse naming later... > Regards > Henrik >
