yahns 1.3.0 → 1.3.1
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.
- checksums.yaml +4 -4
- data/GIT-VERSION-GEN +1 -1
- data/lib/yahns/wbuf.rb +5 -16
- data/test/test_server.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 164544a63a17cfe2b98fb72ad88372ef172e1f36
|
4
|
+
data.tar.gz: 70a7cf50db77f1297f1ea551b18037ae664e3d25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd3e8a33edf8edfdc912d66146234605be0c086d7d80eddb9c01bb9a93fa49e1fb9936b08f2ce2abe3e4ab3cad2405c4224ba6f9cdf400d25f6d0d67a8d82391
|
7
|
+
data.tar.gz: fc2d66c05bba3f5bc21d99d5e015801d7f43d2f8c20cd105507b49c5fe8c1e0a86c562b1e183ab25b2d63b785af77f712a330b50714120598e02065073e8b15d
|
data/GIT-VERSION-GEN
CHANGED
data/lib/yahns/wbuf.rb
CHANGED
@@ -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.
|
75
|
-
@
|
67
|
+
@tmpio.close
|
68
|
+
@sf_offset = 0
|
69
|
+
@tmpio = Yahns::TmpIO.new(@tmpdir)
|
76
70
|
@bypass = true
|
77
71
|
nil
|
78
|
-
end
|
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)
|
data/test/test_server.rb
CHANGED
@@ -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 =
|
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
|
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.
|
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-
|
11
|
+
date: 2014-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kgio
|