summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-11 00:37:58 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-11 00:37:58 +0000
commit78a7866ee11a62a77250bd60113df757c609825a (patch)
tree32e0dee4ccea72aeabc4e2a7194064a42ebf1223 /lib
parentec8392ea46f5c8cc3bea9da2cc2b66d6dbf1ef8a (diff)
merges r32254 from trunk into ruby_1_9_2.
-- fix [Bug #4409]. add DRbServer#here? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@32912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/drb/drb.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb
index 84a21440ed..8970f35648 100644
--- a/lib/drb/drb.rb
+++ b/lib/drb/drb.rb
@@ -1341,6 +1341,7 @@ module DRb
@protocol = DRbProtocol.open_server(uri, @config)
@uri = @protocol.uri
+ @exported_uri = [@uri]
@front = front
@idconv = @config[:idconv]
@@ -1387,6 +1388,10 @@ module DRb
def alive?
@thread.alive?
end
+
+ def here?(uri)
+ @exported_uri.include?(uri)
+ end
# Stop this server.
def stop_service
@@ -1585,6 +1590,10 @@ module DRb
@grp.add Thread.current
Thread.current['DRb'] = { 'client' => client ,
'server' => self }
+ DRb.mutex.synchronize do
+ client_uri = client.uri
+ @exported_uri << client_uri unless @exported_uri.include?(client_uri)
+ end
loop do
begin
succ = false
@@ -1681,7 +1690,8 @@ module DRb
# Is +uri+ the URI for the current local server?
def here?(uri)
- (current_server.uri rescue nil) == uri
+ current_server.here?(uri) rescue false
+ # (current_server.uri rescue nil) == uri
end
module_function :here?