Skip to content

Commit

Permalink
merge revision(s) 36491,36877: [Backport #7320]
Browse files Browse the repository at this point in the history
	Use 0 for webrick's port and get the actual port. [Bug #6766]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
unak committed Nov 15, 2012
1 parent dfc1122 commit d321692
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
6 changes: 3 additions & 3 deletions test/net/http/test_http.rb
Expand Up @@ -426,7 +426,7 @@ def test_set_form_with_file
class TestNetHTTP_v1_2 < Test::Unit::TestCase
CONFIG = {
'host' => '127.0.0.1',
'port' => 10081,
'port' => 0,
'proxy_host' => nil,
'proxy_port' => nil,
}
Expand All @@ -444,7 +444,7 @@ def new
class TestNetHTTP_v1_2_chunked < Test::Unit::TestCase
CONFIG = {
'host' => '127.0.0.1',
'port' => 10081,
'port' => 0,
'proxy_host' => nil,
'proxy_port' => nil,
'chunked' => true,
Expand Down Expand Up @@ -476,7 +476,7 @@ def test_chunked_break
class TestNetHTTPContinue < Test::Unit::TestCase
CONFIG = {
'host' => '127.0.0.1',
'port' => 10081,
'port' => 0,
'proxy_host' => nil,
'proxy_port' => nil,
'chunked' => true,
Expand Down
2 changes: 1 addition & 1 deletion test/net/http/test_https.rb
Expand Up @@ -24,7 +24,7 @@ class TestNetHTTPS < Test::Unit::TestCase

CONFIG = {
'host' => '127.0.0.1',
'port' => 10082, # different from test_http.rb
'port' => 0,
'proxy_host' => nil,
'proxy_port' => nil,
'ssl_enable' => true,
Expand Down
5 changes: 4 additions & 1 deletion test/net/http/utils.rb
Expand Up @@ -19,7 +19,8 @@ def new
end

def config(key)
self.class::CONFIG[key]
@config ||= self.class::CONFIG
@config[key]
end

def logfile
Expand All @@ -42,6 +43,7 @@ def teardown
end

def spawn_server
@config = self.class::CONFIG
server_config = {
:BindAddress => config('host'),
:Port => config('port'),
Expand All @@ -61,6 +63,7 @@ def spawn_server
@server = WEBrick::HTTPServer.new(server_config)
@server.mount('/', Servlet, config('chunked'))
@server.start
@config['port'] = @server[:Port] if @config['port'] == 0
n_try_max = 5
begin
TCPSocket.open(config('host'), config('port')).close
Expand Down
6 changes: 3 additions & 3 deletions version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "1.9.3"
#define RUBY_PATCHLEVEL 330
#define RUBY_PATCHLEVEL 331

#define RUBY_RELEASE_DATE "2012-11-14"
#define RUBY_RELEASE_DATE "2012-11-15"
#define RUBY_RELEASE_YEAR 2012
#define RUBY_RELEASE_MONTH 11
#define RUBY_RELEASE_DAY 14
#define RUBY_RELEASE_DAY 15

#include "ruby/version.h"

Expand Down

0 comments on commit d321692

Please sign in to comment.