summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-08-25 10:52:58 -0700
committerJeremy Evans <code@jeremyevans.net>2019-08-25 10:56:47 -0700
commit71d97a5ef80a23b0bb1005570ed059580981a467 (patch)
tree1b44be385af5b6ea373d2567653d7ec3af9fde87 /sample
parent365e5b38a9ca24116a9c3133e0a0e8ce230ccb02 (diff)
Fix sample/drb/http0serv.rb
Previously, trying to use this would result in: undefined method `uri' for #<DRb::HTTP0::ServerSide:0x00000aec9f1637f8> (NoMethodError) Also, use a relative require to load sample/drb/http0.rb. Fixes [Bug #13431]
Diffstat (limited to 'sample')
-rw-r--r--sample/drb/http0serv.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/sample/drb/http0serv.rb b/sample/drb/http0serv.rb
index 1a58811..2e85331 100644
--- a/sample/drb/http0serv.rb
+++ b/sample/drb/http0serv.rb
@@ -1,6 +1,6 @@
require 'webrick'
require 'drb/drb'
-require 'drb/http0'
+require_relative 'http0'
module DRb
module HTTP0
@@ -61,7 +61,7 @@ module DRb
def accept
client = @queue.pop
- ServerSide.new(client, @config)
+ ServerSide.new(uri, client, @config)
end
def setup_webrick(uri)
@@ -79,12 +79,14 @@ module DRb
end
class ServerSide
- def initialize(callback, config)
+ def initialize(uri, callback, config)
+ @uri = uri
@callback = callback
@config = config
@msg = DRbMessage.new(@config)
@req_stream = StrStream.new(@callback.req_body)
end
+ attr_reader :uri
def close
@callback.close if @callback