Improve parsing of IPv6 addresses

Implement the following rules:
* Interpret [X]:Y as host=X port=Y, if Y is an integer
* Interpret X:Y as host=X port=Y, if Y is an integer and X contains no colon
* Interpret X:Y as host=X:Y port=default otherwise
This commit is contained in:
Pieter Wuille
2012-05-30 22:44:23 +02:00
parent d59bce21e5
commit 1e8aeae15a
2 changed files with 27 additions and 43 deletions

View File

@@ -133,6 +133,7 @@ class CService : public CNetAddr
};
enum Network ParseNetwork(std::string net);
void SplitHostPort(std::string in, int &portOut, std::string &hostOut);
bool SetProxy(enum Network net, CService addrProxy, int nSocksVersion = 5);
bool GetProxy(enum Network net, CService &addrProxy);
bool IsProxy(const CNetAddr &addr);