зеркало из https://github.com/mozilla/labs-vcap.git
Fixed small order of operations error in self.local_ip()
Change-Id: I6f4fe5255aa54e88cf14838f34a65fd9bb6515d5
This commit is contained in:
Родитель
bfc117f5b6
Коммит
e5c1b55155
|
@ -11,7 +11,8 @@ module VCAP
|
|||
|
||||
def self.local_ip(route = A_ROOT_SERVER)
|
||||
route ||= A_ROOT_SERVER
|
||||
orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true
|
||||
orig = Socket.do_not_reverse_lookup
|
||||
Socket.do_not_reverse_lookup = true
|
||||
UDPSocket.open {|s| s.connect(route, 1); s.addr.last }
|
||||
ensure
|
||||
Socket.do_not_reverse_lookup = orig
|
||||
|
|
Загрузка…
Ссылка в новой задаче