yahns 1.3.0 → 1.3.1

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: 8cc5928f1f563c752e54bb5facb8c9a0ca63bcd1
4
- data.tar.gz: 4aced2fa3dbe3e094f724961ce9d840e7ce4d44f
3
+ metadata.gz: 164544a63a17cfe2b98fb72ad88372ef172e1f36
4
+ data.tar.gz: 70a7cf50db77f1297f1ea551b18037ae664e3d25
5
5
  SHA512:
6
- metadata.gz: 939413895994a570e99fc3d5efa2b7513787ea9a22f40d6ab746778a62c664da079d76a3808bbd4e25a0fd65d7a0e6f38db2b96a3b74cd527e0d305ce464d04a
7
- data.tar.gz: 2dabbe0e008fb38b2b9cad8cdc0097565dcaa179ba53ee0bb8266a7f1e737634467f7b0ddc05913acd98f14c465274194129c1258bb5394dfa0557e12f7d9a07
6
+ metadata.gz: cd3e8a33edf8edfdc912d66146234605be0c086d7d80eddb9c01bb9a93fa49e1fb9936b08f2ce2abe3e4ab3cad2405c4224ba6f9cdf400d25f6d0d67a8d82391
7
+ data.tar.gz: fc2d66c05bba3f5bc21d99d5e015801d7f43d2f8c20cd105507b49c5fe8c1e0a86c562b1e183ab25b2d63b785af77f712a330b50714120598e02065073e8b15d
@@ -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.3.0"
7
+ DEF_VER = "v1.3.1"
8
8
  vn = DEF_VER
9
9
 
10
10
  # First see if there is a version file (included in release tarballs),
@@ -30,16 +30,9 @@ require_relative 'wbuf_common'
30
30
  class Yahns::Wbuf # :nodoc:
31
31
  include Yahns::WbufCommon
32
32
 
33
- # TODO: Figure out why this hack is needed to pass output buffering tests.
34
- # It could be a bug in our code, Ruby, the sendfile gem, or FreeBSD itself.
35
- # Tested on FreeBSD fbsd 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898
36
- # We are able to use bypass mode on Linux to reduce buffering in some
37
- # cases. Without bypass mode, we must always finish writing the entire
38
- # response completely before sending more data to the client.
39
- bypass_ok = RUBY_PLATFORM =~ /linux/
40
-
41
33
  def initialize(body, persist, tmpdir)
42
34
  @tmpio = Yahns::TmpIO.new(tmpdir)
35
+ @tmpdir = tmpdir
43
36
  @sf_offset = @sf_count = 0
44
37
  @wbuf_persist = persist # whether or not we keep the connection alive
45
38
  @body = body
@@ -71,16 +64,12 @@ class Yahns::Wbuf # :nodoc:
71
64
 
72
65
  # we're all caught up, try to prevent dirty data from getting flushed
73
66
  # to disk if we can help it.
74
- @tmpio.truncate(@sf_offset = 0)
75
- @tmpio.rewind
67
+ @tmpio.close
68
+ @sf_offset = 0
69
+ @tmpio = Yahns::TmpIO.new(@tmpdir)
76
70
  @bypass = true
77
71
  nil
78
- end if bypass_ok
79
-
80
- def wbuf_write(client, buf)
81
- @sf_count += @tmpio.write(buf)
82
- :wait_writable
83
- end unless bypass_ok
72
+ end
84
73
 
85
74
  # called by last wbuf_flush
86
75
  def wbuf_close(client)
@@ -302,7 +302,7 @@ class TestServer < Testcase
302
302
  end
303
303
 
304
304
  def test_mp_dead_parent
305
- pid, host, port = new_mp_server
305
+ pid, host, port = new_mp_server(1)
306
306
  wpid = nil
307
307
  run_client(host, port) do |res|
308
308
  wpid ||= res.body.to_i
@@ -334,7 +334,7 @@ class TestServer < Testcase
334
334
  c.close
335
335
  end
336
336
 
337
- def new_mp_server(nr = 1)
337
+ def new_mp_server(nr = 2)
338
338
  ru = @ru = tmpfile(%w(config .ru))
339
339
  @ru.puts('a = $$.to_s')
340
340
  @ru.puts('run lambda { |_| [ 200, {"Content-Length"=>a.size.to_s},[a]]}')
@@ -342,7 +342,7 @@ class TestServer < Testcase
342
342
  cfg = Yahns::Config.new
343
343
  host, port = @srv.addr[3], @srv.addr[1]
344
344
  cfg.instance_eval do
345
- worker_processes 2
345
+ worker_processes nr
346
346
  GTL.synchronize { app(:rack, ru.path) { listen "#{host}:#{port}" } }
347
347
  logger(Logger.new(File.open(err.path, "a")))
348
348
  end
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.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - yahns hackers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-12 00:00:00.000000000 Z
11
+ date: 2014-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kgio