aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/webrick/config.rb1
-rw-r--r--lib/webrick/server.rb3
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