mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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]
This commit is contained in:
parent
365e5b38a9
commit
71d97a5ef8
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue