diff options
| author | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-03-23 19:08:03 +0000 |
|---|---|---|
| committer | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-03-23 19:08:03 +0000 |
| commit | 51f7bfbb35db28f0ebdbd3e7adc28ff0e2a30b1b (patch) | |
| tree | bbcb5c6b571ed2b593ae2d43d70e93d97f20c37b /lib/webrick/server.rb | |
| parent | 1699d71c06978386435688f85f1b0068580bfc1c (diff) | |
| download | ruby-51f7bfbb35db28f0ebdbd3e7adc28ff0e2a30b1b.tar.gz ruby-51f7bfbb35db28f0ebdbd3e7adc28ff0e2a30b1b.tar.xz ruby-51f7bfbb35db28f0ebdbd3e7adc28ff0e2a30b1b.zip | |
* lib/webrick/utils.rb (WEBrick::Utils.create_listeners):
- should raise ArgumentError if no port is specified.
- even if the specified port is 0, all TCPServers should be
initialized with the port given to the first one.
* lib/webrick/server.rb (WEBrick::GenericServer#initialize): if :Port
parameter is 0, it should be updated with the port number which
ectually listened.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick/server.rb')
| -rw-r--r-- | lib/webrick/server.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/webrick/server.rb b/lib/webrick/server.rb index 87a33ffaa..46575734c 100644 --- a/lib/webrick/server.rb +++ b/lib/webrick/server.rb @@ -61,6 +61,9 @@ module WEBrick warn(":Listen option is deprecated; use GenericServer#listen") end listen(@config[:BindAddress], @config[:Port]) + if @config[:Port] == 0 + @config[:Port] = @listeners[0].addr[1] + end end end |
