diff options
author | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-11 22:36:11 +0000 |
---|---|---|
committer | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-11 22:36:11 +0000 |
commit | 0d8a0904d93e9600ccd095eabd5e4165c15987ff (patch) | |
tree | 9f0324193639f7ca22731bdbbe6eafa23fed7ccf /lib | |
parent | 3d92d0a135afef7dfc1b9530d3983d97d09fe9cb (diff) | |
download | ruby-0d8a0904d93e9600ccd095eabd5e4165c15987ff.tar.gz |
* lib/webrick/config.rb (WEBrick::Config::General): add
:DoNotReverseLookup.
* lib/webrick/server.rb (WEBrick::GenericServer#accept): call
do_not_reverse_lookup for each socket if :DoNotReverseLookup
is set. [ruby-code:02357]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/webrick/config.rb | 1 | ||||
-rw-r--r-- | lib/webrick/server.rb | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/webrick/config.rb b/lib/webrick/config.rb index 11e1966f13..9d2365e40e 100644 --- a/lib/webrick/config.rb +++ b/lib/webrick/config.rb @@ -33,6 +33,7 @@ module WEBrick :StartCallback => nil, :StopCallback => nil, :AcceptCallback => nil, + :DoNotReverseLookup => nil, } # for HTTPServer, HTTPRequest, HTTPResponse ... diff --git a/lib/webrick/server.rb b/lib/webrick/server.rb index 93e3b2ccf5..0668e27b05 100644 --- a/lib/webrick/server.rb +++ b/lib/webrick/server.rb @@ -90,6 +90,9 @@ module WEBrick @tokens.pop # blocks while no token is there. sock = svr.accept sock.sync = true + if @config[:DoNotReverseLookup] + sock.do_not_reverse_lookup = true + end Utils::set_close_on_exec(sock) th = start_thread(sock, &block) th[:WEBrickThread] = true |