Decrease strictness of parsing IPv4 strings into addrs. (fixes #775)

IPv4 strings in dotted-decimal format with decimal parts containing
leading zeroes now parse better.
This commit is contained in:
Jon Siwek 2012-02-20 14:28:42 -06:00
parent 1f7bfbb83c
commit b66b74e5dc
4 changed files with 72 additions and 1 deletions

View file

@ -261,6 +261,14 @@ public:
unsigned int MemoryAllocation() const { return padded_sizeof(*this); }
/**
* Returns a canonicalized IPv4 dotted-decimal string such that
* leading zeroes of each decimal part are removed.
*
* @param s String containing an IPv4 address in dotted-decimal notation.
*/
static std::string CanonIPv4(const std::string& s);
private:
/**
* Initializes an address instance from a string representation.