diff options
| author | Nuno Santos <nsantos@apache.org> | 2009-11-12 19:14:49 +0000 |
|---|---|---|
| committer | Nuno Santos <nsantos@apache.org> | 2009-11-12 19:14:49 +0000 |
| commit | 13cd0279122f98dc580b006aaf5d99474fc9f6a2 (patch) | |
| tree | 8b6214a890be1ec440a55c91c2b15cb342e0029a /qpid/python/qmf | |
| parent | e855a75494f181c0d77a110eeed9c846a7d8a14a (diff) | |
| download | qpid-python-13cd0279122f98dc580b006aaf5d99474fc9f6a2.tar.gz | |
replace gethostbyname() with getaddrinfo(), which supports IPv6 addresses and is thread-safe
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@835504 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python/qmf')
| -rw-r--r-- | qpid/python/qmf/console.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qpid/python/qmf/console.py b/qpid/python/qmf/console.py index a75c65addc..6326b777e5 100644 --- a/qpid/python/qmf/console.py +++ b/qpid/python/qmf/console.py @@ -97,12 +97,12 @@ class Console: class BrokerURL(URL): def __init__(self, text): URL.__init__(self, text) - socket.gethostbyname(self.host) if self.port is None: if self.scheme == URL.AMQPS: self.port = 5671 else: self.port = 5672 + socket.getaddrinfo(self.host, self.port)[0][4][0] self.authName = None self.authPass = None if self.user: @@ -114,7 +114,7 @@ class BrokerURL(URL): return self.host + ":" + str(self.port) def match(self, host, port): - return socket.gethostbyname(self.host) == socket.gethostbyname(host) and self.port == port + return socket.getaddrinfo(self.host, self.port)[0][4] == socket.gethostbyname(host, port)[0][4] class Object(object): """ This class defines a 'proxy' object representing a real managed object on an agent. |
