This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients ezio.melotti, maker, neologix, pitrou, santoso.wijaya, vstinner
Date 2013-08-29.15:30:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1377790238.08.0.750442196424.issue16201@psf.upfronthosting.co.za>
In-reply-to
Content
> For Windows >= Vista, inet_pton() is available.
> I'm not sure whether XP has one of them: if not, then we might keep
> the hand-parsing as a fallback.

Apparently, XP doesn't have inet_aton()...

So I changed the code to use inet_pton() if available, otherwise use inet_addr(), which is available everywhere (the only gotcha is that it doesn't handle "255.255.255.255", so we special-case it like "<broadcast>").

We thus get rid of the hand-parsing completely, and get a more efficient  handling of numeric IPv4 addresses, and a much more efficient handling for numeric IPv6 addresses (see above benchmarks).
History
Date User Action Args
2013-08-29 15:30:38neologixsetrecipients: + neologix, pitrou, vstinner, ezio.melotti, santoso.wijaya, maker
2013-08-29 15:30:38neologixsetmessageid: <1377790238.08.0.750442196424.issue16201@psf.upfronthosting.co.za>
2013-08-29 15:30:38neologixlinkissue16201 messages
2013-08-29 15:30:38neologixcreate