disable reverse lookup by default. [ruby-core:45514] [Feature #6559]
Socket.do_not_reverse_lookup is true by default but WEBrick
overwrote it.
patch by Eric Hodel [ruby-core:45527]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/httprequest.rb (setup_forwarded_info): Use the first
value in X-Forwarded-Proto, if header contains multiple comma
separated values. Some middlewares may add these values to the
list, not replacing. [Fix GH-1386]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to invoke ssl server with command line.
[fix GH-1329] Patch by @kerlin
* test/webrick/test_ssl_server.rb: Added test for GH-1329
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
override the body more easily. [fix GH-1307]
* test/webrick/test_httpresponse.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize):
use WEBrick::Utils::TimeoutHandler::Thread, which is ignored by
LeakChecker#find_threads, instead of ::Thread to get rid of
thread leak checker. since this TimeoutHandler is resident
during tests because of Singleton, it waits for the next timeout
if it has any schedules. in the case of nested timeouts, inner
timeout does not cancel outer timeouts and then those schedules
still remain.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
potential deadlocks, Queue is used to tell update of @timeout_info
instead of sleep and wakeup. [Bug #11742] [ruby-dev:49387]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
When you change this to true, you may need to add more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
TimeoutMutex only when accessing @timeout_info for avoiding
potential deadlock. [Bug #11742] [ruby-dev:49387]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
TimeoutMutex should be acquired when accessing @timeout_info.
To avoid deadlock, interrupt() calls are delayed.
Due to the mutex, it is safe to treat ary without ary.dup.
[Bug #11742] [ruby-dev:49387]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#register):
notify the handler thread of new timeout registration.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize):
make sleep intervals adaptive than fixed period intervals.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/server.rb (WEBrick::GenericServer#start): flush
shutdown pipe.
* lib/webrick/server.rb (WEBrick::GenericServer#stop): request the
server to stop immediately by sending data via shutdown pipe.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
IO#nonblock= and IO#close_on_exec= methods are simpler-to-use
and potentially more portable to for future OSes.
IO#nonblock= and IO#close_on_exec= are also smart enough to avoid
redundantly setting flags so a syscall may be avoided.
These methods could probably be removed entirely and inlined, but
it's unclear if there is 3rd-party code which relies on them.
* lib/webrick/utils.rb (set_non_blocking): use IO#nonblock=
* (set_close_on_exec): use IO#close_on_exec=
[Feature #11136]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Sockets are close-on-exec by default since Ruby 2.0, so it
is redundant to set it again.
* lib/webrick/server.rb (accept_client): avoid redundant fcntl call
[Feature #11137]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
In case a process encounters high-numbered FDs, this allows
consistent performance on systems with ppoll support.
[ruby-core:35572]
* ext/socket/lib/socket.rb (connect_nonblock): use IO#wait_writable
* lib/drb/drb.rb (DRB::DRbTCPSocket#alive?): use IO#wait_readable
* lib/webrick/httpserver.rb (run): ditto
* lib/resolv.rb (request): ditto for single socket case
[ruby-core:68943] [Feature #11081]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
notify readability on the read side of the pipe.
write_nonblock() is not usable for pipe on Windows.
(cleanup_shutdown_pipe): Rescue IOError for @shutdown_pipe_w.close.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to avoid race condition.
(cleanup_shutdown_pipe): New private method.
(cleanup_listener): Extracted from shutdown method.
Call this method from start method to avoid race condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler::Thread):
use particular class to mark by the class name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
shutdown() or close() for listening socket is not a reliable.
Actually, both doesn't work (doesn't wake up select()) on
DragonFly BSD 3.6.2.
* test/webrick/utils.rb: :ShutdownSocketWithoutClose is not required
now to immediate server shutdown detection.
This fixes fd leaks.
* test/net/http/utils.rb: Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): stop
handling requests on shutdown, even if the socket is readable
and IO.select() returns true. [Fixes GH-607]
* lib/webrick/server.rb (WEBrick::GenericServer#start): IO.select()
raises ENOTSOCK on shutdown on Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/httpservlet/filehandler.rb (set_dir_list): pass the
given queries to subdirectories.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e