かわじ、です。
> Apache の HostnameLookups を取り入れてみました。
すみません、何度も。
DoNotListen が偽の時だけ、HostnameLookups の設定が反映されるように
しました。
これで、Virtual Host がたくさんあっても、大元の server にだけ
HostnameLookups を設定すれば良いようになりました。
Index: lib/webrick/config.rb
===================================================================
RCS file: /src/ruby/lib/webrick/config.rb,v
retrieving revision 1.2
diff -u -r1.2 config.rb
--- lib/webrick/config.rb 8 Sep 2003 09:52:33 -0000 1.2
+++ lib/webrick/config.rb 28 Jan 2004 07:43:01 -0000
@@ -30,6 +30,7 @@
"(Ruby/#{RUBY_VERSION}/#{RUBY_RELEASE_DATE})",
:TempDir => ENV['TMPDIR']||ENV['TMP']||ENV['TEMP']||'/tmp',
:DoNotListen => false,
+ :HostnameLookups => true, # reverse lookup
:StartCallback => nil,
:StopCallback => nil,
:AcceptCallback => nil,
Index: lib/webrick/server.rb
===================================================================
RCS file: /src/ruby/lib/webrick/server.rb,v
retrieving revision 1.5
diff -u -r1.5 server.rb
--- lib/webrick/server.rb 4 Dec 2003 00:12:14 -0000 1.5
+++ lib/webrick/server.rb 28 Jan 2004 07:43:02 -0000
@@ -61,6 +61,7 @@
warn(":Listen option is deprecated; use GenericServer#listen")
end
listen(@config[:BindAddress], @config[:Port])
+ BasicSocket.do_not_reverse_lookup = !(@config[:HostnameLookups])
end
end