aboutsummaryrefslogtreecommitdiffstats
path: root/lib/webrick
Commit message (Collapse)AuthorAgeFilesLines
* * lib/webrick/ssl.rb: Accept string value for SSLCertName. It is usedhsbt2016-05-071-1/+2
| | | | | | | | 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
* * lib/webrick/ssl.rb: Support to add SSLCiphers option.hsbt2016-04-221-0/+4
| | | | | | [fix GH-1321] Patch by @rhadoo git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpresponse.rb: Move error_body to method. It allow tohsbt2016-03-291-4/+8
| | | | | | | 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/httpservlet/filehandler.rb: fix documentation for namespace.hsbt2016-01-251-1/+2
| | | | | | [fix GH-1219][ci skip] Patch by @leafac git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stdlib: avoid extra calls to eliminate "\n" from Base64normal2016-01-102-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | We may use the '0' (zero) to avoid adding the line feed. Furthermore, the '*' (asterisk) modifier is not needed for a single-element arrays. * ext/psych/lib/psych/visitors/yaml_tree.rb (visit_String): eliminate chomp * lib/net/http.rb (connect): eliminate delete * lib/net/http/header.rb (basic_encode): ditto * lib/net/imap.rb (authenticate): eliminate gsub (self.encode_utf7): shorten delete arg * lib/net/smtp.rb (base64_encode): eliminate gsub * lib/open-uri.rb (OpenURI.open_http): eliminate delete * lib/rss/rss.rb: ditto * lib/securerandom.rb (base64): ditto (urlsafe_base64): eliminate delete! * lib/webrick/httpauth/digestauth.rb (split_param_value): eliminate chop * lib/webrick/httpproxy.rb (do_CONNECT): eliminate delete (setup_upstream_proxy_authentication): ditto [ruby-core:72666] [Feature #11938] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* leakchecker.rb: remove temporary measurenobu2016-01-051-7/+31
| | | | | | | | | | | | | * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#watcher): make watcher thread restartable. * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#terminate): new method to terminate watcher thread. * test/lib/leakchecker.rb (LeakChecker#find_threads): revert r46941. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpstatus.rb: Added HTTP 451 Status Code.hsbt2015-12-301-0/+1
| | | | | | | [fix GH-1167] Patch by @MuhammetDilmac https://tools.ietf.org/html/draft-tbray-http-legally-restricted-status-00 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* webrick/utils.rb: get rid of thread leak checkernobu2015-12-191-2/+3
| | | | | | | | | | | | | * 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
* * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): To preventngoto2015-12-181-6/+8
| | | | | | | | 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
* Add frozen_string_literal: false for all filesnaruse2015-12-1634-0/+34
| | | | | | 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
* * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): Acquirengoto2015-12-151-21/+22
| | | | | | | | 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
* * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize):ngoto2015-12-151-9/+14
| | | | | | | | | | 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/httpauth/basicauth.rb: fix a typo.hsbt2015-11-162-4/+2
| | | | | | | [ci skip][fix GH-1099] Patch by @jwworth * lib/webrick/httpauth/digestauth.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb: use IO::NULL instead of '/dev/null'hsbt2015-08-271-3/+3
| | | | | | * test/ruby/test_string.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* webrick/utils.rb: wakeup immediatelynobu2015-07-141-3/+7
| | | | | | | * 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
* webrick/utils.rb: adaptive sleepnobu2015-07-141-4/+12
| | | | | | | * 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
* webrick/server.rb: stop immediatelynobu2015-07-141-11/+22
| | | | | | | | | * 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
* httpproxy.rb: fix typos [ci skip]nobu2015-07-131-2/+2
| | | | | | | * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#do_CONNECT): fix typos in debugger statements. [Fix GH-967] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/utils.rb: simplify by avoiding fcntlnormal2015-05-171-9/+3
| | | | | | | | | | | | | | | | 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
* lib/webrick/server.rb: avoid redundant fcntl callnormal2015-05-171-1/+0
| | | | | | | | | | 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
* stdlib: use IO#wait_*able instead of IO.select when possiblenormal2015-05-061-1/+2
| | | | | | | | | | | | | | 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
* * lib/webrick/server.rb: Fix regression bug in WEBrick'shsbt2015-03-161-1/+3
| | | | | | | | :DoNotReverseLookup config option implementation. [fix GH-731] Patch by @vais * test/webrick/test_do_not_reverse_lookup.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb: Invoke setup_shutdown_pipe in start methodakr2015-03-101-1/+3
| | | | | | | | | instead of listen method. [ruby-core:68476] [Bug #10956] Reported by Shintaro Kojima. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/utils.rb: removed unused argument variable.hsbt2015-01-023-3/+3
| | | | | | | | | [fix GH-356] Patch by @vipulnsward * lib/webrick/server.rb: ditto. * lib/webrick/ssl.rb: ditto. * test/webrick/test_utils.rb: added test for WEBrick::Utils#create_listeners. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb: Setup shutdown pipe in listen method.akr2014-11-102-1/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb: Less instance variables.akr2014-11-101-17/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb (shutdown): Use close() on @shutdown_pipe_w toakr2014-11-101-4/+6
| | | | | | | | | | 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
* * lib/webrick/server.rb (initialize): Initialize shutdown pipe hereakr2014-11-091-40/+39
| | | | | | | | | | | 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/httpstatus.rb: require webrick/accesslog for AccessLog.akr2014-11-091-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb: Stop lisntner loop properly.akr2014-11-051-1/+1
| | | | | | | | [ruby-core:66085] [Bug #10478] Fixed by Charles Nutter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* normalize reference to Timeout::Errornormal2014-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | From: John Bachir <j@jjb.cc> * bootstraptest/test_io.rb (assert_finish): normalize rescue for Timeout::Error * lib/net/ftp.rb (Net#read_timeout): ditto for doc * lib/resolv.rb (Resolv::ResolvTimeout): ditto for subclass * lib/webrick/httprequest.rb (_read_data): ditto for rescue * sample/timeout.rb (p timeout): ditto for call * test/drb/drbtest.rb (test_06_timeout): ditto * test/ruby/test_readpartial.rb (test_open_pipe): ditto * test/thread/test_queue.rb (test_queue_thread_raise): ditto * thread.c (rb_thread_s_handle_interrupt): ditto for doc [ruby-core:65481] [misc #10339] TimeoutError is a legacy constant, Timeout::Error is the canonical constant. This patch normalizes all code and comments to reference Timeout::Error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpproxy.rb: remove needless conditionhsbt2014-08-081-2/+0
| | | | | | for old ruby version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* webrick/utils.rb: mark by class namenobu2014-07-021-3/+2
| | | | | | | * 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
* * lib/webrick/utils.rb (create_listeners): Close socket objects.akr2014-06-281-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpproxy.rb: remvoe useless assigned variables.hsbt2014-06-264-6/+3
| | | | | | | | * lib/webrick/httpservlet/cgihandler.rb: ditto. * lib/webrick/httpservlet/erbhandler.rb: ditto. * lib/webrick/server.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/gserver.rb: remove redundant use of to_s in interpolation.hsbt2014-06-241-1/+1
| | | | | | | | | | * lib/logger.rb: ditto. * lib/optparse.rb: ditto. * lib/rbconfig/obsolete.rb: ditto. * lib/resolv.rb: ditto. * lib/webrick/httpresponse.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb: Use a pipe to detect server shutdown.akr2014-05-301-1/+26
| | | | | | | | | | | | | | | | 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/utils.rb: Override the inspect method of the threadakr2014-05-251-0/+3
| | | | | | | | used in WEBrick::Utils::TimeoutHandler. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* webrick/httpserver.rb: Stop handling requests on shutdownnobu2014-05-082-3/+3
| | | | | | | | | | * 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/utils.rb: Don't rescue LoadError for 'etc' extension.akr2014-04-251-6/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/fileutils.rb (fu_get_uid, fu_get_gid): Etc.getpwnam/getgrnam mayusa2014-04-241-2/+1
| | | | | | | | | returns nil. * lib/webrick/utils.rb (su): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* httpservlet/filehandler.rb: pass queriesnobu2014-02-121-1/+2
| | | | | | | * 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
* * lib/webrick/ssl.rb: [DOC] Fix typoa_matsuda2013-12-251-1/+1
| | | | | | | s/willbe/will be/ [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/sample/olegen.rb: Fix typoa_matsuda2013-12-111-1/+1
| | | | | | | | | | * ext/openssl/ossl_asn1.c: [DOC] Fix typo * lib/webrick/accesslog.rb: ditto * template/yarvarch.ja: ditto s/recieve/receive/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpstatus.rb: [DOC] Fix typoa_matsuda2013-12-061-1/+1
| | | | | | | s/sucess/success/ [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/compat.rb, lib/xmlrpc/datetime.rb: [DOC] fix typo by ↵hsbt2013-12-061-1/+1
| | | | | | @vipulnsward [fix GH-464] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httprequest.rb: [DOC] Fix broken link of CGI specification ↵hsbt2013-12-061-1/+2
| | | | | | by @udzura [fix GH-466] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpresponse.rb: [DOC] Fix typoa_matsuda2013-12-051-1/+1
| | | | | | | s/resopnse/response/ [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpproxy.rb: [DOC] Fix typoa_matsuda2013-12-041-1/+1
| | | | | | | s/bacause/because/ [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpauth/digestauth.rb: Fix typo in an error message.a_matsuda2013-11-291-1/+1
| | | | | | | | * test/ruby/test_parse.rb: Fix typo in a test name. s/allowd/allowed/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e