yahns 1.10.0 → 1.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c643fa72cb1ded8e5ce3999d579e12a7076df0b
4
- data.tar.gz: 54d4e4b0d98944eacd73fadbdf7d7f508707b6f0
3
+ metadata.gz: 147b339e7cb3eec02dc6e6e482fe8a08bf5d2ad0
4
+ data.tar.gz: 56e54e9e277aaa32b642a6f7680d5b899ed208d2
5
5
  SHA512:
6
- metadata.gz: 7d13c33de59bd992eff2b56855d415bad109f7835039647907f91c64e7ab2e0802fcc09e3dd5c621ebb935c134c93f2f75d58e5f2e8e52c7c6ecff15c6f1c6bd
7
- data.tar.gz: 80c8fc880ce803efb7598bac519cb197931c5e39c2330738b5cc40a8fbeffd592f72ee545f9e1527da8c9c7a96301f095d86b53d330fdbe03af34ed0840d6298
6
+ metadata.gz: d8427b2bdb6a6ae2d0b8bfd445b6bac230cf40e0675d43365e689896aac769d0cafd201a61215ab1075a91e7e8e09ef6797ae7ae9132ae1da20c48f199350622
7
+ data.tar.gz: 9e015af7565846e6a913d02fed38ff7ebc040779acb53caf6a7fd417c31e9ebe3a054105ecf1c3a19e9671b7ba7d08ecfe53a20adf15fa1fa26cc46fdded23c4
@@ -49,6 +49,10 @@ environment variables will also affect it.
49
49
  yahns will update the PWD (current working directory) env if the
50
50
  working_directory directive is set (see yahns_config(5)).
51
51
 
52
+ LISTEN_FDS and LISTEN_PID variables are used in our emulation
53
+ of sd_listen_fds(3) function. See sd_listen_fds(3) manpage
54
+ for more details.
55
+
52
56
  # FILES
53
57
 
54
58
  See yahns_config(5) for documentation on the configuration file format.
@@ -65,4 +69,4 @@ License: GPLv3 or later <http://www.gnu.org/licenses/gpl-3.0.txt>
65
69
 
66
70
  # SEE ALSO
67
71
 
68
- yahns-rackup(1), yahns_config(5)
72
+ yahns-rackup(1), yahns_config(5), sd_listen_fds(3)
data/GIT-VERSION-FILE CHANGED
@@ -1 +1 @@
1
- VERSION = 1.10.0
1
+ VERSION = 1.11.0
data/GIT-VERSION-GEN CHANGED
@@ -4,7 +4,7 @@
4
4
  CONSTANT = "Yahns::VERSION"
5
5
  RVF = "lib/yahns/version.rb"
6
6
  GVF = "GIT-VERSION-FILE"
7
- DEF_VER = "v1.10.0"
7
+ DEF_VER = "v1.11.0"
8
8
  vn = DEF_VER
9
9
 
10
10
  # First see if there is a version file (included in release tarballs),
data/NEWS CHANGED
@@ -1,3 +1,19 @@
1
+ === yahns 1.11.0 - more minor updates / 2015-12-13 02:20 UTC
2
+
3
+ There's some minor test case fixes and documentation updates.
4
+
5
+ For OpenSSL users running the Ruby 2.3.0 preview releases,
6
+ we now use `exception: false' for for accept_nonblock to reduce
7
+ exceptions. Non-SSL I/O still uses kgio for now.
8
+
9
+ 6 changes since 1.10.0:
10
+ wbuf: fix typo in bug check for sendfile gem
11
+ test_wbuf: deal with proper zero-copy for Unix sockets
12
+ README: clarify and update copyright year
13
+ doc: document and reference sd_listen_fds(3) behavior
14
+ test_server: fix race condition in hooks test
15
+ openssl_client: use `exception: false' for accept_nonblock
16
+
1
17
  === yahns 1.10.0 - minor updates / 2015-11-01 09:08 UTC
2
18
 
3
19
  * test_client_expire: favor Process.spawn over fork+exec
data/README CHANGED
@@ -55,19 +55,17 @@ Contact
55
55
 
56
56
  We are happy to see feedback of all types via plain-text email.
57
57
  Please send comments, user/dev discussion, patches, bug reports,
58
- and pull requests to the public inbox/mailing list at:
58
+ and pull requests to the open-to-all mailing list at:
59
59
 
60
60
  yahns-public@yhbt.net
61
61
 
62
62
  No subscription is necessary to post. Please Cc: all recipients as
63
63
  subscription is not necessary.
64
64
 
65
- You may subscribe by sending an email to:
65
+ You may optionally subscribe by sending an email to:
66
66
 
67
67
  yahns-public+subscribe@yhbt.net
68
68
 
69
- You may also subscribe to the public-inbox at git://yhbt.net/yahns-public
70
- using ssoma <http://ssoma.public-inbox.org/>
71
69
  Mailing list archives browsable via HTTP: http://yhbt.net/yahns-public/
72
70
  Or NNTP: nntp://news.public-inbox.org/inbox.comp.lang.ruby.yahns
73
71
 
@@ -127,7 +125,7 @@ processes to work around low FD limits as well as contention in the:
127
125
  Copyright
128
126
  ---------
129
127
 
130
- Copyright 2013-2014, all contributors (see git repo).
128
+ Copyright 2013-2015, all contributors (see git repo).
131
129
  License: GPLv3 or later <https://www.gnu.org/licenses/gpl-3.0.txt>
132
130
 
133
131
  yahns is copyrighted Free Software by all contributors, see logs in
@@ -53,14 +53,9 @@ module Yahns::OpenSSLClient # :nodoc:
53
53
  if @need_accept
54
54
  # most protocols require read before write, so we start the negotiation
55
55
  # process here:
56
- begin
57
- @ssl.accept_nonblock
58
- rescue IO::WaitReadable
59
- return :wait_readable
60
- rescue IO::WaitWritable
61
- return :wait_writable
62
- rescue OpenSSL::SSL::SSLError
63
- return nil
56
+ case rv = accept_nonblock(@ssl)
57
+ when :wait_readable, :wait_writable, nil
58
+ return rv
64
59
  end
65
60
  @need_accept = false
66
61
  end
@@ -71,4 +66,20 @@ module Yahns::OpenSSLClient # :nodoc:
71
66
  @ssl.close # flushes SSLSocket
72
67
  super # IO#close
73
68
  end
69
+
70
+ if RUBY_VERSION.to_f >= 2.3
71
+ def accept_nonblock(ssl)
72
+ ssl.accept_nonblock(exception: false)
73
+ end
74
+ else
75
+ def accept_nonblock(ssl)
76
+ ssl.accept_nonblock
77
+ rescue IO::WaitReadable
78
+ :wait_readable
79
+ rescue IO::WaitWritable
80
+ :wait_writable
81
+ rescue OpenSSL::SSL::SSLError
82
+ nil
83
+ end
84
+ end
74
85
  end
data/lib/yahns/version.rb CHANGED
@@ -1 +1 @@
1
- Yahns::VERSION = '1.10.0' # :nodoc:
1
+ Yahns::VERSION = '1.11.0' # :nodoc:
data/lib/yahns/wbuf.rb CHANGED
@@ -71,7 +71,7 @@ class Yahns::Wbuf # :nodoc:
71
71
  @busy = rv
72
72
  return rv
73
73
  else
74
- raise "BUG: #{rv.nil ? "EOF" : rv.inspect} on tmpio " \
74
+ raise "BUG: #{rv.nil? ? "EOF" : rv.inspect} on tmpio " \
75
75
  "sf_offset=#@sf_offset sf_count=#@sf_count"
76
76
  end while @sf_count > 0
77
77
 
data/man/yahns.1 CHANGED
@@ -53,6 +53,10 @@ also affect it.
53
53
  .PP
54
54
  yahns will update the PWD (current working directory) env if the
55
55
  working_directory directive is set (see yahns_config(5)).
56
+ .PP
57
+ LISTEN_FDS and LISTEN_PID variables are used in our emulation of
58
+ sd_listen_fds(3) function.
59
+ See sd_listen_fds(3) manpage for more details.
56
60
  .SH FILES
57
61
  .PP
58
62
  See yahns_config(5) for documentation on the configuration file format.
@@ -69,4 +73,4 @@ Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
69
73
  License: GPLv3 or later <http://www.gnu.org/licenses/gpl-3.0.txt>
70
74
  .SH SEE ALSO
71
75
  .PP
72
- yahns-rackup(1), yahns_config(5)
76
+ yahns-rackup(1), yahns_config(5), sd_listen_fds(3)
data/test/test_server.rb CHANGED
@@ -433,7 +433,7 @@ class TestServer < Testcase
433
433
  stderr_path err.path
434
434
  stdout_path out.path
435
435
  end
436
- pid = mkserver(cfg)
436
+ master_pid = pid = mkserver(cfg)
437
437
  c = get_tcp_client(host, port)
438
438
  c.write("GET / HTTP/1.0\r\nHost: example.com\r\n\r\n")
439
439
  buf = Timeout.timeout(10) { c.read }
@@ -442,19 +442,24 @@ class TestServer < Testcase
442
442
  assert_match(/200 OK/, head)
443
443
  assert_match(/\A\d+\z/, body)
444
444
  worker_pid = body.to_i
445
+
446
+ # ensure atfork_parent has run
447
+ quit_wait(master_pid)
448
+ master_pid = nil
449
+
445
450
  lines = out.readlines.map!(&:chomp!)
446
451
  out.close!
447
452
 
448
453
  assert_match %r{INFO hihi from app\.atfork_child}, File.read(err.path)
449
454
 
450
- assert_equal 3, lines.size
455
+ assert_equal 3, lines.size, lines.join("\n")
451
456
  assert_equal("af #{pid} parent about to spawn", lines.shift)
452
457
 
453
458
  # child/parent ordering is not guaranteed
454
459
  assert_equal 1, lines.grep(/\Aaf #{pid} this is probably not useful\z/).size
455
460
  assert_equal 1, lines.grep(/\Aaf #{worker_pid} worker is running\z/).size
456
461
  ensure
457
- quit_wait(pid)
462
+ quit_wait(master_pid)
458
463
  end
459
464
 
460
465
  def test_mp_hooks_worker_nr
data/test/test_wbuf.rb CHANGED
@@ -71,8 +71,17 @@ class TestWbuf < Testcase
71
71
  end while true
72
72
  end
73
73
  wbuf = Yahns::Wbuf.new([], true, Dir.tmpdir, :wait_writable)
74
- assert_equal :wait_writable, wbuf.wbuf_write(a, buf)
75
- assert_equal :wait_writable, wbuf.wbuf_flush(a)
74
+
75
+ rv1 = wbuf.wbuf_write(a, buf)
76
+ rv2 = wbuf.wbuf_flush(a)
77
+ case rv1
78
+ when nil
79
+ assert_equal true, rv2, 'some kernels succeed with real sendfile'
80
+ when :wait_writable
81
+ assert_equal :wait_writable, rv2, 'some block on sendfile'
82
+ else
83
+ flunk "unexpected from wbuf_write/flush: #{rv1.inspect} / #{rv2.inspect}"
84
+ end
76
85
 
77
86
  # drain the buffer
78
87
  Timeout.timeout(10) { b.read(b.nread) until b.nread == 0 }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yahns
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - yahns hackers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-01 00:00:00.000000000 Z
11
+ date: 2015-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kgio
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
221
  version: '0'
222
222
  requirements: []
223
223
  rubyforge_project:
224
- rubygems_version: 2.5.0
224
+ rubygems_version: 2.5.1
225
225
  signing_key:
226
226
  specification_version: 4
227
227
  summary: sleepy, multi-threaded, non-blocking application server