yahns 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/.olddoc.yml +7 -0
  4. data/Documentation/.gitignore +1 -1
  5. data/Documentation/GNUmakefile +1 -1
  6. data/Documentation/yahns-rackup.txt +1 -1
  7. data/Documentation/yahns.txt +1 -1
  8. data/Documentation/yahns_config.txt +1 -1
  9. data/GIT-VERSION-FILE +1 -1
  10. data/GIT-VERSION-GEN +2 -2
  11. data/GNUmakefile +1 -1
  12. data/HACKING +1 -1
  13. data/NEWS +494 -504
  14. data/README +2 -1
  15. data/Rakefile +5 -69
  16. data/bin/yahns +1 -1
  17. data/bin/yahns-rackup +1 -1
  18. data/extras/README +1 -1
  19. data/extras/autoindex.rb +1 -1
  20. data/extras/exec_cgi.rb +1 -1
  21. data/extras/try_gzip_static.rb +4 -2
  22. data/lib/yahns/acceptor.rb +1 -1
  23. data/lib/yahns/cap_input.rb +1 -1
  24. data/lib/yahns/client_expire_generic.rb +1 -1
  25. data/lib/yahns/client_expire_tcpi.rb +1 -1
  26. data/lib/yahns/config.rb +5 -2
  27. data/lib/yahns/daemon.rb +2 -2
  28. data/lib/yahns/fdmap.rb +1 -1
  29. data/lib/yahns/http_client.rb +1 -1
  30. data/lib/yahns/http_context.rb +1 -1
  31. data/lib/yahns/http_response.rb +1 -1
  32. data/lib/yahns/log.rb +2 -2
  33. data/lib/yahns/max_body/rewindable_wrapper.rb +1 -1
  34. data/lib/yahns/max_body/wrapper.rb +1 -1
  35. data/lib/yahns/max_body.rb +1 -1
  36. data/lib/yahns/proxy_http_response.rb +2 -2
  37. data/lib/yahns/proxy_pass.rb +4 -1
  38. data/lib/yahns/queue_egg.rb +1 -1
  39. data/lib/yahns/queue_epoll.rb +1 -1
  40. data/lib/yahns/queue_kqueue.rb +1 -1
  41. data/lib/yahns/queue_quitter.rb +1 -1
  42. data/lib/yahns/queue_quitter_pipe.rb +1 -1
  43. data/lib/yahns/rack.rb +1 -1
  44. data/lib/yahns/sendfile_compat.rb +1 -1
  45. data/lib/yahns/server.rb +6 -6
  46. data/lib/yahns/server_mp.rb +1 -1
  47. data/lib/yahns/sigevent.rb +1 -1
  48. data/lib/yahns/sigevent_efd.rb +1 -1
  49. data/lib/yahns/sigevent_pipe.rb +1 -1
  50. data/lib/yahns/socket_helper.rb +1 -1
  51. data/lib/yahns/stream_file.rb +1 -1
  52. data/lib/yahns/stream_input.rb +1 -1
  53. data/lib/yahns/tcp_server.rb +1 -1
  54. data/lib/yahns/tee_input.rb +1 -1
  55. data/lib/yahns/tmpio.rb +1 -1
  56. data/lib/yahns/unix_server.rb +1 -1
  57. data/lib/yahns/version.rb +1 -1
  58. data/lib/yahns/wbuf_common.rb +1 -1
  59. data/lib/yahns/wbuf_str.rb +1 -1
  60. data/lib/yahns/worker.rb +1 -1
  61. data/lib/yahns.rb +1 -1
  62. data/man/yahns-rackup.1 +1 -4
  63. data/man/yahns.1 +1 -4
  64. data/man/yahns_config.5 +1 -4
  65. data/test/covshow.rb +1 -1
  66. data/test/helper.rb +1 -1
  67. data/test/server_helper.rb +1 -1
  68. data/test/test_bin.rb +1 -1
  69. data/test/test_buffer_tmpdir.rb +1 -1
  70. data/test/test_client_expire.rb +3 -4
  71. data/test/test_client_max_body_size.rb +1 -1
  72. data/test/test_config.rb +1 -1
  73. data/test/test_expect_100.rb +1 -1
  74. data/test/test_extras_autoindex.rb +1 -1
  75. data/test/test_extras_exec_cgi.rb +1 -1
  76. data/test/test_extras_exec_cgi.sh +1 -1
  77. data/test/test_extras_try_gzip_static.rb +1 -1
  78. data/test/test_fdmap.rb +1 -1
  79. data/test/test_input.rb +1 -1
  80. data/test/test_mt_accept.rb +1 -1
  81. data/test/test_output_buffering.rb +1 -1
  82. data/test/test_rack.rb +1 -1
  83. data/test/test_rack_hijack.rb +1 -1
  84. data/test/test_reopen_logs.rb +1 -1
  85. data/test/test_response.rb +1 -1
  86. data/test/test_serve_static.rb +1 -1
  87. data/test/test_server.rb +1 -1
  88. data/test/test_stream_file.rb +1 -1
  89. data/test/test_unix_socket.rb +1 -1
  90. data/test/test_wbuf.rb +1 -1
  91. data/yahns.gemspec +4 -4
  92. metadata +10 -9
data/README CHANGED
@@ -68,7 +68,8 @@ You may subscribe by sending an email to:
68
68
 
69
69
  You may also subscribe to the public-inbox at git://yhbt.net/yahns-public
70
70
  using ssoma <http://ssoma.public-inbox.org/>
71
- Mailing list archives browsable at: http://yhbt.net/yahns-public/
71
+ Mailing list archives browsable via HTTP: http://yhbt.net/yahns-public/
72
+ Or NNTP: nntp://news.public-inbox.org/inbox.comp.lang.ruby.yahns
72
73
 
73
74
  This README is our homepage, we would rather be working on HTTP servers
74
75
  all day than worrying about the next browser vulnerability because
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
1
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
2
2
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
  require 'tempfile'
4
4
  include Rake::DSL
@@ -61,76 +61,12 @@ def tags
61
61
  end.compact.sort { |a,b| b[:time] <=> a[:time] }
62
62
  end
63
63
 
64
- url_base = 'http://yahns.yhbt.net'
65
- cgit_url = 'http://yhbt.net/yahns.git'
66
- git_url = 'git://yhbt.net/yahns.git'
67
- since = "v0.0.2"
68
-
69
64
  desc 'prints news as an Atom feed'
70
65
  task "NEWS.atom.xml" do
71
- require 'nokogiri'
72
- new_tags = tags[0,10]
73
- time = nil
74
- str = Nokogiri::XML::Builder.new do
75
- feed :xmlns => "http://www.w3.org/2005/Atom" do
76
- id! "#{url_base}/NEWS.atom.xml"
77
- title "yahns news"
78
- subtitle "sleepy, multi-threaded, non-blocking Ruby application server"
79
- link! :rel => 'alternate', :type => 'text/plain',
80
- :href => "#{url_base}/NEWS"
81
- updated(new_tags.empty? ? "1970-01-01T00:00:00Z" : new_tags.first[:time])
82
- new_tags.each do |tag|
83
- time ||= tag[:time_obj]
84
- entry do
85
- title tag[:subject]
86
- updated tag[:time]
87
- published tag[:time]
88
- author {
89
- name tag[:tagger_name]
90
- email tag[:tagger_email]
91
- }
92
- url = "#{cgit_url}/tag/?id=#{tag[:tag]}"
93
- link! :rel => "alternate", :type => "text/html", :href =>url
94
- id! url
95
- message_only = tag[:body].split(/\n.+\(\d+\):\n {6}/).first.strip
96
- content({:type =>:text}, message_only)
97
- content(:type =>:xhtml) { pre tag[:body] }
98
- end
99
- end
100
- end
101
- end.to_xml
102
-
103
- fp = Tempfile.new("NEWS.atom.xml", ".")
104
- fp.sync = true
105
- fp.write(str)
106
- fp.chmod 0644
107
- File.utime(time, time, fp.path) if time
108
- File.rename(fp.path, "NEWS.atom.xml")
109
- fp.close!
66
+ # gem install 'olddoc', 'olddoc prepare' has no API besides the
67
+ # command-line. This requires olddoc 1.1 or later.
68
+ system('olddoc', 'prepare') or abort "olddoc prepare failed #$?"
110
69
  end
111
70
 
112
71
  desc 'prints news as a text file'
113
- task "NEWS" do
114
- fp = Tempfile.new("NEWS", ".")
115
- fp.sync = true
116
- time = nil
117
- tags.each do |tag|
118
- time ||= tag[:time_obj]
119
- line = tag[:subject] + " / " + tag[:time].sub(/T.*/, '')
120
- fp.puts line
121
- fp.puts("-" * line.length)
122
- fp.puts
123
- fp.puts tag[:body]
124
- fp.puts
125
- end
126
- fp.write("Unreleased\n\n") unless fp.size > 0
127
- fp.puts "COPYRIGHT"
128
- fp.puts "---------"
129
- bdfl = 'Eric Wong <normalperson@yhbt.net>'
130
- fp.puts "Copyright (C) 2013, #{bdfl} and all contributors"
131
- fp.puts "License: GPLv3 or later (http://www.gnu.org/licenses/gpl-3.0.txt)"
132
- fp.chmod 0644
133
- File.utime(time, time, fp.path) if time
134
- File.rename(fp.path, "NEWS")
135
- fp.close!
136
- end
72
+ task 'NEWS' => 'NEWS.atom.xml'
data/bin/yahns CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/this/will/be/overwritten/or/wrapped/anyways/do/not/worry/ruby
2
2
  # -*- encoding: binary -*-
3
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
3
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
4
4
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
5
5
  require 'yahns/daemon'
6
6
  require 'optparse'
data/bin/yahns-rackup CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/this/will/be/overwritten/or/wrapped/anyways/do/not/worry/ruby
2
2
  # -*- encoding: binary -*-
3
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
3
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
4
4
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
5
5
  require 'yahns/rackup_handler'
6
6
  ARGV.grep(/\A(?:-s|--server)/)[0] and abort "--server has no effect for #$0"
data/extras/README CHANGED
@@ -12,5 +12,5 @@ of future API compatibility at all.
12
12
  Copyright
13
13
  ---------
14
14
 
15
- Copyright 2013, Eric Wong <normalperson@yhbt.net> and all contributors.
15
+ Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
16
16
  License: GPLv3 or later <https://www.gnu.org/licenses/gpl-3.0.txt>
data/extras/autoindex.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  require 'time'
5
5
  require 'rack/utils'
data/extras/exec_cgi.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv2 or later (https://www.gnu.org/licenses/gpl-2.0.txt)
4
4
  #
5
5
  # if running under yahns, worker_processes is recommended to avoid conflicting
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  require 'time'
5
5
  require 'rack/utils'
@@ -92,7 +92,9 @@ class TryGzipStatic
92
92
  path = fspath(env) or return r(403)
93
93
  begin
94
94
  st = File.stat(path)
95
- st.file? ? [ path, st ] : r(404)
95
+ return r(404) unless st.file?
96
+ return r(403) unless st.readable?
97
+ [ path, st ]
96
98
  rescue Errno::ENOENT, Errno::ENOTDIR
97
99
  r(404)
98
100
  rescue Errno::EACCES
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> et. al.
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (see COPYING for details)
4
4
  require_relative 'client_expire_tcpi'
5
5
  require_relative 'client_expire_generic'
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2009-2013, Eric Wong <normalperson@yhbt.net> et. al.
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv2 or later (https://www.gnu.org/licenses/gpl-2.0.txt)
4
4
 
5
5
  # This is used as the @input/env["rack.input"] when
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
1
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
2
2
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
  module Yahns::ClientExpireGeneric # :nodoc:
4
4
  def __timestamp
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
1
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
2
2
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
  require 'raindrops'
4
4
 
data/lib/yahns/config.rb CHANGED
@@ -1,12 +1,15 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  #
5
5
  # Implements a DSL for configuring a yahns server.
6
6
  # See http://yahns.yhbt.net/examples/yahns_multi.conf.rb for a full
7
7
  # example configuration file.
8
8
  class Yahns::Config # :nodoc:
9
- APP_CLASS = {} # public, see yahns/rack for usage example
9
+ # public within yahns itself, NOT a public interface for users outside
10
+ # of yahns. See yahns/rack for usage example
11
+ APP_CLASS = {}
12
+
10
13
  CfgBlock = Struct.new(:type, :ctx) # :nodoc:
11
14
  attr_reader :config_file, :config_listeners, :set
12
15
  attr_reader :qeggs, :app_ctx
data/lib/yahns/daemon.rb CHANGED
@@ -46,9 +46,9 @@ module Yahns::Daemon # :nodoc:
46
46
  master_pid = (rd.readpartial(16) rescue nil).to_i
47
47
  unless master_pid > 1
48
48
  warn "master failed to start, check stderr log for details"
49
- exit!(1)
49
+ exit!
50
50
  end
51
- exit 0
51
+ exit
52
52
  else # yahns master process
53
53
  yahns_server.daemon_pipe = wr
54
54
  end
data/lib/yahns/fdmap.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
1
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
2
2
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
  require 'thread'
4
4
 
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  class Yahns::HttpClient < Kgio::Socket # :nodoc:
5
5
  NULL_IO = StringIO.new("")
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
 
5
5
  # subclasses of Yahns::HttpClient will class extend this
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  require_relative 'stream_file'
5
5
  require_relative 'wbuf_str'
data/lib/yahns/log.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
 
5
5
  # logging-related utility functions for all of yahns
@@ -66,7 +66,7 @@ module Yahns::Log # :nodoc:
66
66
  # MRI will use freopen(3) here internally on std{in,out,err}
67
67
  fp.reopen(fp.path, "a")
68
68
  else
69
- # We should not need this: http://bugs.ruby-lang.org/issues/9036
69
+ # We should not need this: https://bugs.ruby-lang.org/issues/9036
70
70
  # MRI will not call call fclose(3) or freopen(3) here
71
71
  # since there's no associated std{in,out,err} FILE * pointer
72
72
  # This should atomically use dup3(2) (or dup2(2)) syscall
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2009-2013, Eric Wong <normalperson@yhbt.net> et. al.
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv2 or later (https://www.gnu.org/licenses/gpl-2.0.txt)
4
4
  class Yahns::MaxBody::RewindableWrapper < Yahns::MaxBody::Wrapper # :nodoc:
5
5
  def initialize(rack_input, limit)
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2009-2013, Eric Wong <normalperson@yhbt.net> et. al.
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv2 or later (https://www.gnu.org/licenses/gpl-2.0.txt)
4
4
  #
5
5
  # This is only used for chunked request bodies, which are rare
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2009-2013, Eric Wong <normalperson@yhbt.net> et. al.
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv2 or later (https://www.gnu.org/licenses/gpl-2.0.txt)
4
4
 
5
5
  # Middleware used to enforce client_max_body_size for TeeInput users.
@@ -91,8 +91,8 @@ module Yahns::HttpResponse # :nodoc:
91
91
 
92
92
  # For now, do not add a Date: header, assume upstream already did it
93
93
  # but do not care if they did not
94
- res << (alive ? "Connection: keep-alive\r\n\r\n"
95
- : "Connection: close\r\n\r\n")
94
+ res << (alive ? "Connection: keep-alive\r\n\r\n".freeze
95
+ : "Connection: close\r\n\r\n".freeze)
96
96
 
97
97
  # send the headers
98
98
  case rv = kgio_syssend(res, flags)
@@ -74,7 +74,10 @@ class Yahns::ProxyPass # :nodoc:
74
74
  rescue => e
75
75
  # avoid polluting logs with a giant backtrace when the problem isn't
76
76
  # fixable in code.
77
- e.set_backtrace([]) if Errno::ECONNREFUSED === e
77
+ case e
78
+ when Errno::ECONNREFUSED, Errno::ECONNRESET, Errno::EPIPE
79
+ e.set_backtrace([])
80
+ end
78
81
  c.proxy_err_response(502, self, e, nil)
79
82
  end
80
83
 
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
1
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
2
2
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
 
4
4
  # this represents a Yahns::Queue before its vivified. This only
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  #
5
5
  # This is the dangerous, low-level epoll interface for sleepy_penguin
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2014, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  #
5
5
  # This is the dangerous, low-level kqueue interface for sleepy_penguin
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
1
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
2
2
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
 
4
4
  require 'sleepy_penguin'
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
1
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
2
2
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
  #
4
4
  # POSIX pipe version, see queue_quitter.rb for the (preferred) eventfd one
data/lib/yahns/rack.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  require 'rack'
5
5
  class Yahns::Rack # :nodoc:
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2009-2014, Eric Wong <normalperson@yhbt.net> et. al.
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
 
5
5
  module Yahns::SendfileCompat
data/lib/yahns/server.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
1
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
2
2
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
  require_relative 'queue_quitter'
4
4
  require_relative 'tcp_server'
@@ -316,14 +316,14 @@ class Yahns::Server # :nodoc:
316
316
 
317
317
  # emulate sd_listen_fds() for systemd
318
318
  sd_pid, sd_fds = ENV.values_at('LISTEN_PID', 'LISTEN_FDS')
319
- if sd_pid && sd_pid.to_i == $$
319
+ if sd_pid.to_i == $$
320
320
  # 3 = SD_LISTEN_FDS_START
321
- inherited.concat((3...(3 + sd_fds.to_i)).map { |fd| Socket.for_fd(fd) })
321
+ inherited.concat((3...(3 + sd_fds.to_i)).to_a)
322
322
  end
323
323
  # to ease debugging, we will not unset LISTEN_PID and LISTEN_FDS
324
324
 
325
325
  inherited.map! do |fd|
326
- io = String === fd ? Socket.for_fd(fd.to_i) : fd
326
+ io = Socket.for_fd(fd.to_i)
327
327
  opts = sock_opts(io)
328
328
  io = server_cast(io, opts)
329
329
  set_server_sockopt(io, opts)
@@ -401,7 +401,7 @@ class Yahns::Server # :nodoc:
401
401
  @logger.info("graceful exit aborted, exiting immediately")
402
402
  # we will still call any app-defined at_exit hooks here
403
403
  # use SIGKILL if you don't want that.
404
- exit(0)
404
+ exit
405
405
  end
406
406
 
407
407
  drop_acceptors # stop acceptors, we close epolls in quit_done
@@ -463,7 +463,7 @@ class Yahns::Server # :nodoc:
463
463
  when :CHLD
464
464
  reap_reexec
465
465
  when :USR1
466
- usr1_reopen('')
466
+ usr1_reopen(nil)
467
467
  when :USR2
468
468
  reexec
469
469
  when :HUP
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  module Yahns::ServerMP # :nodoc:
5
5
  EXIT_SIGS = [ :QUIT, :TERM, :INT ]
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net>
1
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
2
2
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
  if SleepyPenguin.const_defined?(:EventFD)
4
4
  require_relative 'sigevent_efd'
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  class Yahns::Sigevent < SleepyPenguin::EventFD # :nodoc:
5
5
  include Kgio::DefaultWaiters
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  class Yahns::Sigevent # :nodoc:
5
5
  attr_reader :to_io
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  # this is only meant for Yahns::Server
5
5
  module Yahns::SocketHelper # :nodoc:
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> et. al.
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  require_relative 'wbuf_common'
5
5
 
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2009-2013, Eric Wong <normalperson@yhbt.net> et. al.
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv2 or later (https://www.gnu.org/licenses/gpl-2.0.txt)
4
4
 
5
5
  # When processing uploads, Yahns may expose a StreamInput object under
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> et. al.
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (see COPYING for details)
4
4
  require_relative 'acceptor'
5
5
  class Yahns::TCPServer < Kgio::TCPServer # :nodoc:
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2009-2013, Eric Wong <normalperson@yhbt.net> et. al.
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv2 or later (https://www.gnu.org/licenses/gpl-2.0.txt)
4
4
 
5
5
  # acts like tee(1) on an input input to provide a input-like stream
data/lib/yahns/tmpio.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2009-2013, Eric Wong <normalperson@yhbt.net> et. al.
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv2 or later (https://www.gnu.org/licenses/gpl-2.0.txt)
4
4
  require 'tmpdir'
5
5
 
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> et. al.
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (see COPYING for details)
4
4
  require_relative 'acceptor'
5
5
  class Yahns::UNIXServer < Kgio::UNIXServer # :nodoc:
data/lib/yahns/version.rb CHANGED
@@ -1 +1 @@
1
- Yahns::VERSION = '1.9.0' # :nodoc:
1
+ Yahns::VERSION = '1.10.0' # :nodoc:
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2009-2013, Eric Wong <normalperson@yhbt.net> et. al.
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  begin
5
5
  raise LoadError, "SENDFILE_BROKEN env set" if ENV["SENDFILE_BROKEN"]
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> et. al.
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  require_relative 'wbuf_common'
5
5
 
data/lib/yahns/worker.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
3
3
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
  class Yahns::Worker # :nodoc:
5
5
  attr_accessor :nr
data/lib/yahns.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
1
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
2
2
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
  $stdout.sync = $stderr.sync = true
4
4
 
data/man/yahns-rackup.1 CHANGED
@@ -164,10 +164,7 @@ All feedback welcome via plain-text mail to <yahns-public@yhbt.net>
164
164
  No subscription is necessary to post to the mailing list.
165
165
  .SH COPYRIGHT
166
166
  .PP
167
- Copyright 2013, Eric Wong <normalperson@yhbt.net> and all contributors.
168
- .PD 0
169
- .P
170
- .PD
167
+ Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
171
168
  License: GPLv3 or later <http://www.gnu.org/licenses/gpl-3.0.txt>
172
169
  .SH SEE ALSO
173
170
  .PP
data/man/yahns.1 CHANGED
@@ -65,10 +65,7 @@ All feedback welcome via plain-text mail to <yahns-public@yhbt.net>
65
65
  No subscription is necessary to post to the mailing list.
66
66
  .SH COPYRIGHT
67
67
  .PP
68
- Copyright 2013, Eric Wong <normalperson@yhbt.net> and all contributors.
69
- .PD 0
70
- .P
71
- .PD
68
+ Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
72
69
  License: GPLv3 or later <http://www.gnu.org/licenses/gpl-3.0.txt>
73
70
  .SH SEE ALSO
74
71
  .PP
data/man/yahns_config.5 CHANGED
@@ -668,10 +668,7 @@ git\ clone\ git://yhbt.net/yahns.git
668
668
  .fi
669
669
  .SH COPYRIGHT
670
670
  .PP
671
- Copyright 2013, Eric Wong <normalperson@yhbt.net> and all contributors.
672
- .PD 0
673
- .P
674
- .PD
671
+ Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
675
672
  License: GPLv3 or later <http://www.gnu.org/licenses/gpl-3.0.txt>
676
673
  .SH SEE ALSO
677
674
  .PP
data/test/covshow.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
1
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
2
2
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
  #
4
4
  # this works with the __covmerge method in test/helper.rb
data/test/helper.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
1
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
2
2
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
  $stdout.sync = $stderr.sync = Thread.abort_on_exception = true
4
4
  $-w = true if RUBY_VERSION.to_f >= 2.0
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
1
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
2
2
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
  require_relative 'helper'
4
4
  require 'timeout'
data/test/test_bin.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
1
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
2
2
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
  require_relative 'server_helper'
4
4
  class TestBin < Testcase
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
1
+ # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
2
2
  # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
  require_relative 'server_helper'
4
4
  require 'sleepy_penguin'