tipi 0.52 → 0.54

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
  SHA256:
3
- metadata.gz: efec664af01dfb4781c30670e2471a591a6c8df3a8024b5f14dc4edded3f5c1d
4
- data.tar.gz: 0f384c5a305c5afe524b9a0e28d2a06931340275fe879e963cc194d2cde3c766
3
+ metadata.gz: 9d233f020bba51d04d83ad3bc0af0fba949a4988ed206cb3eb27c6cb66e9d581
4
+ data.tar.gz: 7462a9e229e3d78dbed4ffac92029b6fa117df683b425102f6de259eab8adc2c
5
5
  SHA512:
6
- metadata.gz: 7aa3995cd7ad560f3ba0f8a318da6c5ef62d53bc02209f05491f1e3db5b140e2697e8cd3158686a62c3dbae373d0260d803befabf4b8c417e862f2e6f68860bf
7
- data.tar.gz: 7a17368c2fd9572531ac137822727082e48b85322190b91197f699d34d0554fd39d5dc7a18fe6f68bf8ea64dadbabbb464f39fa2b83475ee52cee99484c422a5
6
+ metadata.gz: d0fff68a7a6848dbaf6a3b5f846ada34542b532bc42d79821c47981354214c914130fda8192ffe12bc334554264297000afe82742388713de87356e17e6dc8a6
7
+ data.tar.gz: d8e9c715aace1b1dc26a78a5463016f4d0a65c552fa865a8b471ccb60955abd350304d1ae7db1ddaeebd4577ded25b048078c3e4fe39abe5e32385cbb5eddae3
data/.github/FUNDING.yml CHANGED
@@ -1 +1 @@
1
- github: ciconia
1
+ github: noteflakes
@@ -8,7 +8,7 @@ jobs:
8
8
  fail-fast: false
9
9
  matrix:
10
10
  os: [ubuntu-latest, macos-latest]
11
- ruby: ['2.7', '3.0', '3.1', 'head']
11
+ ruby: ['3.0', '3.1', '3.2', 'head']
12
12
 
13
13
  name: >-
14
14
  ${{matrix.os}}, ${{matrix.ruby}}
@@ -16,7 +16,7 @@ jobs:
16
16
  runs-on: ${{matrix.os}}
17
17
 
18
18
  env:
19
- POLYPHONY_USE_LIBEV: "1"
19
+ POLYPHONY_LIBEV: "1"
20
20
 
21
21
  steps:
22
22
  - name: Setup machine
@@ -27,7 +27,5 @@ jobs:
27
27
  ruby-version: ${{matrix.ruby}}
28
28
  bundler-cache: true # 'bundle install' and cache
29
29
  cache-version: 2
30
- - name: Show Linux kernel version
31
- run: uname -r
32
30
  - name: Run tests
33
31
  run: bundle exec rake test
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 0.54 2023-05-28
2
+
3
+ - Use `H1P.send_response` for sending response
4
+ - Update Polyphony and H1P versions
5
+
6
+ ## 0.53 2022-10-04
7
+
8
+ - Disregard `SystemCallError` in `Tipi.client_loop`
9
+
1
10
  ## 0.52 2022-03-03
2
11
 
3
12
  - Treat HTTP/2 headers as immutable
data/Gemfile.lock CHANGED
@@ -1,15 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tipi (0.52)
4
+ tipi (0.54)
5
5
  acme-client (~> 2.0.9)
6
6
  ever (~> 0.1)
7
- extralite (~> 1.14)
8
- h1p (~> 0.4)
7
+ extralite (~> 1.25)
8
+ h1p (~> 0.6.1)
9
9
  http-2 (~> 0.11)
10
10
  localhost (~> 1.1.4)
11
11
  msgpack (~> 1.4.2)
12
- polyphony (~> 0.80)
12
+ polyphony (~> 1.0.2)
13
13
  qeweney (~> 0.18)
14
14
  rack (>= 2.0.8, < 2.3.0)
15
15
  websocket (~> 1.2.8)
@@ -17,49 +17,32 @@ PATH
17
17
  GEM
18
18
  remote: https://rubygems.org/
19
19
  specs:
20
- acme-client (2.0.9)
21
- faraday (>= 0.17, < 2.0.0)
20
+ acme-client (2.0.13)
21
+ faraday (>= 1.0, < 3.0.0)
22
+ faraday-retry (>= 1.0, < 3.0.0)
22
23
  cuba (3.9.3)
23
24
  rack (>= 1.6.0)
24
25
  docile (1.4.0)
25
- escape_utils (1.2.1)
26
- ever (0.1)
27
- extralite (1.14)
28
- faraday (1.10.0)
29
- faraday-em_http (~> 1.0)
30
- faraday-em_synchrony (~> 1.0)
31
- faraday-excon (~> 1.1)
32
- faraday-httpclient (~> 1.0)
33
- faraday-multipart (~> 1.0)
34
- faraday-net_http (~> 1.0)
35
- faraday-net_http_persistent (~> 1.0)
36
- faraday-patron (~> 1.0)
37
- faraday-rack (~> 1.0)
38
- faraday-retry (~> 1.0)
26
+ escape_utils (1.2.2)
27
+ ever (0.2)
28
+ extralite (1.26)
29
+ faraday (2.7.5)
30
+ faraday-net_http (>= 2.0, < 3.1)
39
31
  ruby2_keywords (>= 0.0.4)
40
- faraday-em_http (1.0.0)
41
- faraday-em_synchrony (1.0.0)
42
- faraday-excon (1.1.0)
43
- faraday-httpclient (1.0.1)
44
- faraday-multipart (1.0.3)
45
- multipart-post (>= 1.2, < 3)
46
- faraday-net_http (1.0.1)
47
- faraday-net_http_persistent (1.2.0)
48
- faraday-patron (1.0.0)
49
- faraday-rack (1.0.0)
50
- faraday-retry (1.0.3)
51
- h1p (0.4)
32
+ faraday-net_http (3.0.2)
33
+ faraday-retry (2.1.0)
34
+ faraday (~> 2.0)
35
+ h1p (0.6.1)
52
36
  http-2 (0.11.0)
53
- json (2.6.1)
54
- localhost (1.1.9)
55
- memory_profiler (1.0.0)
37
+ json (2.6.3)
38
+ localhost (1.1.10)
39
+ memory_profiler (1.0.1)
56
40
  minitest (5.11.3)
57
41
  msgpack (1.4.5)
58
- multipart-post (2.1.1)
59
- polyphony (0.81)
42
+ polyphony (1.0.2)
60
43
  qeweney (0.18)
61
44
  escape_utils (~> 1.2.1)
62
- rack (2.2.3)
45
+ rack (2.2.7)
63
46
  rake (13.0.6)
64
47
  ruby2_keywords (0.0.5)
65
48
  simplecov (0.17.1)
@@ -160,21 +160,15 @@ module Tipi
160
160
  # response API
161
161
 
162
162
  CRLF = "\r\n"
163
- CRLF_ZERO_CRLF_CRLF = "\r\n0\r\n\r\n"
164
-
163
+
165
164
  # Sends response including headers and body. Waits for the request to complete
166
165
  # if not yet completed. The body is sent using chunked transfer encoding.
167
166
  # @param request [Qeweney::Request] HTTP request
168
167
  # @param body [String] response body
169
168
  # @param headers
170
169
  def respond(request, body, headers)
171
- formatted_headers = format_headers(headers, body, false)
172
- request.tx_incr(formatted_headers.bytesize + (body ? body.bytesize : 0))
173
- if body
174
- @conn.write(formatted_headers, body)
175
- else
176
- @conn.write(formatted_headers)
177
- end
170
+ written = H1P.send_response(@conn, headers, body)
171
+ request.tx_incr(written)
178
172
  end
179
173
 
180
174
  CHUNK_LENGTH_PROC = ->(len) { "#{len.to_s(16)}\r\n" }
data/lib/tipi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tipi
4
- VERSION = '0.52'
4
+ VERSION = '0.54'
5
5
  end
data/lib/tipi.rb CHANGED
@@ -48,6 +48,8 @@ module Tipi
48
48
  client.no_delay if client.respond_to?(:no_delay)
49
49
  adapter = protocol_adapter(client, opts)
50
50
  adapter.each(&handler)
51
+ rescue SystemCallError
52
+ # disregard
51
53
  ensure
52
54
  client.close rescue nil
53
55
  end
@@ -34,7 +34,7 @@ class HTTP1ServerTest < MiniTest::Test
34
34
 
35
35
  response = connection.readpartial(8192)
36
36
  expected = <<~HTTP.chomp.crlf_lines.chomp
37
- HTTP/1.1 200
37
+ HTTP/1.1 200 OK
38
38
  Content-Length: 13
39
39
 
40
40
  Hello, world!
@@ -52,7 +52,7 @@ class HTTP1ServerTest < MiniTest::Test
52
52
 
53
53
  response = connection.readpartial(8192)
54
54
  expected = <<~HTTP.crlf_lines.chomp
55
- HTTP/1.1 200
55
+ HTTP/1.1 200 OK
56
56
  Content-Length: 13
57
57
 
58
58
  Hello, world!
@@ -68,13 +68,13 @@ class HTTP1ServerTest < MiniTest::Test
68
68
  connection << "GET / HTTP/1.0\r\nConnection: keep-alive\r\n\r\n"
69
69
  response = connection.readpartial(8192)
70
70
  assert !connection.eof?
71
- assert_equal("HTTP/1.1 200\r\nContent-Length: 2\r\n\r\nHi", response)
71
+ assert_equal("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nHi", response)
72
72
 
73
73
  connection << "GET / HTTP/1.1\r\n\r\n"
74
74
  response = connection.readpartial(8192)
75
75
  assert !connection.eof?
76
76
  expected = <<~HTTP.crlf_lines.chomp
77
- HTTP/1.1 200
77
+ HTTP/1.1 200 OK
78
78
  Content-Length: 2
79
79
 
80
80
  Hi
@@ -84,7 +84,7 @@ class HTTP1ServerTest < MiniTest::Test
84
84
  connection << "GET / HTTP/1.0\r\n\r\n"
85
85
  response = connection.readpartial(8192)
86
86
  assert connection.eof?
87
- assert_equal("HTTP/1.1 200\r\nContent-Length: 2\r\n\r\nHi", response)
87
+ assert_equal("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nHi", response)
88
88
  end
89
89
 
90
90
  def test_pipelining_client
@@ -101,10 +101,10 @@ class HTTP1ServerTest < MiniTest::Test
101
101
  response = connection.readpartial(8192)
102
102
 
103
103
  expected = <<~HTTP.crlf_lines.chomp
104
- HTTP/1.1 200
104
+ HTTP/1.1 200 OK
105
105
  Content-Length: 13
106
106
 
107
- Hello, world!HTTP/1.1 200
107
+ Hello, world!HTTP/1.1 200 OK
108
108
  Content-Length: 14
109
109
 
110
110
  Hello, foobar!
@@ -193,7 +193,7 @@ class HTTP1ServerTest < MiniTest::Test
193
193
  response = connection.readpartial(8192)
194
194
  assert !connection.eof?
195
195
  expected = <<~HTTP.crlf_lines.chomp
196
- HTTP/1.1 200
196
+ HTTP/1.1 200 OK
197
197
  Content-Length: 2
198
198
 
199
199
  Hi
data/tipi.gemspec CHANGED
@@ -22,11 +22,11 @@ Gem::Specification.new do |s|
22
22
 
23
23
  s.executables = ['tipi']
24
24
 
25
- s.add_runtime_dependency 'polyphony', '~>0.80'
25
+ s.add_runtime_dependency 'polyphony', '~>1.0.2'
26
26
  s.add_runtime_dependency 'ever', '~>0.1'
27
27
  s.add_runtime_dependency 'qeweney', '~>0.18'
28
- s.add_runtime_dependency 'extralite', '~>1.14'
29
- s.add_runtime_dependency 'h1p', '~>0.4'
28
+ s.add_runtime_dependency 'extralite', '~>1.25'
29
+ s.add_runtime_dependency 'h1p', '~>0.6.1'
30
30
 
31
31
  s.add_runtime_dependency 'http-2', '~>0.11'
32
32
  s.add_runtime_dependency 'rack', '>=2.0.8', '<2.3.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tipi
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.52'
4
+ version: '0.54'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-03 00:00:00.000000000 Z
11
+ date: 2023-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: polyphony
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.80'
19
+ version: 1.0.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.80'
26
+ version: 1.0.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ever
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.14'
61
+ version: '1.25'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.14'
68
+ version: '1.25'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: h1p
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.4'
75
+ version: 0.6.1
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.4'
82
+ version: 0.6.1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: http-2
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -377,7 +377,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
377
377
  - !ruby/object:Gem::Version
378
378
  version: '0'
379
379
  requirements: []
380
- rubygems_version: 3.1.6
380
+ rubygems_version: 3.4.1
381
381
  signing_key:
382
382
  specification_version: 4
383
383
  summary: Tipi - the All-in-one Web Server for Ruby Apps