async-http 0.52.0 → 0.52.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/async/http/body/delayed.rb +6 -2
- data/lib/async/http/body/hijack.rb +6 -0
- data/lib/async/http/body/slowloris.rb +2 -2
- data/lib/async/http/body/writable.rb +4 -0
- data/lib/async/http/endpoint.rb +2 -2
- data/lib/async/http/internet.rb +4 -0
- data/lib/async/http/protocol/http1/client.rb +1 -1
- data/lib/async/http/protocol/http1/server.rb +4 -3
- data/lib/async/http/version.rb +1 -1
- metadata +18 -74
- data/.editorconfig +0 -6
- data/.github/workflows/development.yml +0 -52
- data/.gitignore +0 -15
- data/.rspec +0 -3
- data/.travis.yml +0 -35
- data/Gemfile +0 -11
- data/README.md +0 -365
- data/async-http.gemspec +0 -39
- data/bake.rb +0 -0
- data/examples/compare/Gemfile +0 -9
- data/examples/compare/benchmark.rb +0 -78
- data/examples/download/chunked.rb +0 -86
- data/examples/fetch/Gemfile +0 -3
- data/examples/fetch/Gemfile.lock +0 -74
- data/examples/fetch/README.md +0 -3
- data/examples/fetch/config.ru +0 -28
- data/examples/fetch/public/index.html +0 -23
- data/examples/fetch/public/stream.js +0 -56
- data/examples/google/search.rb +0 -47
- data/examples/request.rb +0 -38
- data/examples/stream/stop.rb +0 -28
- data/examples/trenni/Gemfile +0 -5
- data/examples/trenni/streaming.rb +0 -35
- data/examples/upload/client.rb +0 -39
- data/examples/upload/data.txt +0 -41
- data/examples/upload/server.rb +0 -19
- data/examples/upload/upload.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f3f0a32ca906a1af82161acfe4d4256748c1d2e7a8792e9973abf7f203df7d9
|
4
|
+
data.tar.gz: 0f2e158de8e076bb7af74b3ac268e1a0260169ae2fee56925b2fd244f668f904
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53a44e49b1502fb8cb2e6d2234b7ea94831b4b6f391f9ee48c842aeea0a80f517143894fb10c98499fdbb2f1bb23994ad26d82735c9912f4333975acfdc6b1af
|
7
|
+
data.tar.gz: 53052f74772e143a831df936aad2f4687b045ae1d2ccf7bcf598d6e8b105ec3c5e47ffb20bc72ecc7fe07b6701d8f3155ba717aa6cebd065caf0506cb5ed1c70
|
@@ -20,18 +20,22 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
21
|
# THE SOFTWARE.
|
22
22
|
|
23
|
-
|
23
|
+
require 'protocol/http/body/wrapper'
|
24
24
|
|
25
25
|
module Async
|
26
26
|
module HTTP
|
27
27
|
module Body
|
28
|
-
class Delayed <
|
28
|
+
class Delayed < Protocol::HTTP::Body::Wrapper
|
29
29
|
def initialize(body, delay = 0.01)
|
30
30
|
super(body)
|
31
31
|
|
32
32
|
@delay = delay
|
33
33
|
end
|
34
34
|
|
35
|
+
def ready?
|
36
|
+
false
|
37
|
+
end
|
38
|
+
|
35
39
|
def read
|
36
40
|
Async::Task.current.sleep(@delay)
|
37
41
|
|
@@ -37,8 +37,8 @@ module Async
|
|
37
37
|
|
38
38
|
# In order for this implementation to work correctly, you need to use a LimitedQueue.
|
39
39
|
# @param minimum_throughput [Integer] the minimum bytes per second otherwise this body will be forcefully closed.
|
40
|
-
def initialize(*
|
41
|
-
super(*
|
40
|
+
def initialize(*arguments, minimum_throughput: 1024, **options)
|
41
|
+
super(*arguments, **options)
|
42
42
|
|
43
43
|
@minimum_throughput = minimum_throughput
|
44
44
|
|
data/lib/async/http/endpoint.rb
CHANGED
data/lib/async/http/internet.rb
CHANGED
@@ -56,7 +56,7 @@ module Async
|
|
56
56
|
|
57
57
|
# Server loop.
|
58
58
|
def each(task: Task.current)
|
59
|
-
task.annotate("Reading #{version} requests for #{self.class}.")
|
59
|
+
task.annotate("Reading #{self.version} requests for #{self.class}.")
|
60
60
|
|
61
61
|
while request = next_request
|
62
62
|
response = yield(request, self)
|
@@ -90,16 +90,17 @@ module Async
|
|
90
90
|
body.call(stream)
|
91
91
|
else
|
92
92
|
head = request.head?
|
93
|
+
version = request.version
|
93
94
|
|
94
95
|
request = nil unless body
|
95
96
|
response = nil
|
96
97
|
|
97
|
-
write_body(
|
98
|
+
write_body(version, body, head, trailers)
|
98
99
|
end
|
99
100
|
else
|
100
101
|
# If the request failed to generate a response, it was an internal server error:
|
101
102
|
write_response(@version, 500, {})
|
102
|
-
write_body(
|
103
|
+
write_body(request.version, nil)
|
103
104
|
end
|
104
105
|
|
105
106
|
# Gracefully finish reading the request body if it was not already done so.
|
data/lib/async/http/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.52.
|
4
|
+
version: 0.52.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -58,28 +58,28 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.20.0
|
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: 0.
|
68
|
+
version: 0.20.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: protocol-http1
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.13.0
|
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.
|
82
|
+
version: 0.13.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: protocol-http2
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,47 +95,33 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 0.14.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name: async-
|
98
|
+
name: async-container
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '0.14'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '0.14'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name: async-
|
112
|
+
name: async-rspec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: '1.10'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: rack-test
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
124
|
+
version: '1.10'
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
126
|
name: covered
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,21 +137,7 @@ dependencies:
|
|
151
137
|
- !ruby/object:Gem::Version
|
152
138
|
version: '0'
|
153
139
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - ">="
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - ">="
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
167
|
-
- !ruby/object:Gem::Dependency
|
168
|
-
name: bake-bundler
|
140
|
+
name: rack-test
|
169
141
|
requirement: !ruby/object:Gem::Requirement
|
170
142
|
requirements:
|
171
143
|
- - ">="
|
@@ -192,42 +164,14 @@ dependencies:
|
|
192
164
|
- - "~>"
|
193
165
|
- !ruby/object:Gem::Version
|
194
166
|
version: '3.6'
|
195
|
-
description:
|
167
|
+
description:
|
196
168
|
email:
|
197
|
-
- samuel.williams@oriontransfer.co.nz
|
198
169
|
executables: []
|
199
170
|
extensions: []
|
200
171
|
extra_rdoc_files: []
|
201
172
|
files:
|
202
|
-
- ".editorconfig"
|
203
|
-
- ".github/workflows/development.yml"
|
204
|
-
- ".gitignore"
|
205
|
-
- ".rspec"
|
206
|
-
- ".travis.yml"
|
207
|
-
- Gemfile
|
208
|
-
- README.md
|
209
|
-
- async-http.gemspec
|
210
|
-
- bake.rb
|
211
173
|
- bake/async/http.rb
|
212
174
|
- bake/async/http/h2spec.rb
|
213
|
-
- examples/compare/Gemfile
|
214
|
-
- examples/compare/benchmark.rb
|
215
|
-
- examples/download/chunked.rb
|
216
|
-
- examples/fetch/Gemfile
|
217
|
-
- examples/fetch/Gemfile.lock
|
218
|
-
- examples/fetch/README.md
|
219
|
-
- examples/fetch/config.ru
|
220
|
-
- examples/fetch/public/index.html
|
221
|
-
- examples/fetch/public/stream.js
|
222
|
-
- examples/google/search.rb
|
223
|
-
- examples/request.rb
|
224
|
-
- examples/stream/stop.rb
|
225
|
-
- examples/trenni/Gemfile
|
226
|
-
- examples/trenni/streaming.rb
|
227
|
-
- examples/upload/client.rb
|
228
|
-
- examples/upload/data.txt
|
229
|
-
- examples/upload/server.rb
|
230
|
-
- examples/upload/upload.rb
|
231
175
|
- lib/async/http.rb
|
232
176
|
- lib/async/http/body.rb
|
233
177
|
- lib/async/http/body/delayed.rb
|
@@ -270,7 +214,7 @@ homepage: https://github.com/socketry/async-http
|
|
270
214
|
licenses:
|
271
215
|
- MIT
|
272
216
|
metadata: {}
|
273
|
-
post_install_message:
|
217
|
+
post_install_message:
|
274
218
|
rdoc_options: []
|
275
219
|
require_paths:
|
276
220
|
- lib
|
@@ -285,8 +229,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
285
229
|
- !ruby/object:Gem::Version
|
286
230
|
version: '0'
|
287
231
|
requirements: []
|
288
|
-
rubygems_version: 3.
|
289
|
-
signing_key:
|
232
|
+
rubygems_version: 3.0.3
|
233
|
+
signing_key:
|
290
234
|
specification_version: 4
|
291
235
|
summary: A HTTP client and server library.
|
292
236
|
test_files: []
|
data/.editorconfig
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
name: Development
|
2
|
-
|
3
|
-
on: [push, pull_request]
|
4
|
-
|
5
|
-
jobs:
|
6
|
-
test:
|
7
|
-
runs-on: ${{matrix.os}}-latest
|
8
|
-
continue-on-error: ${{matrix.experimental}}
|
9
|
-
|
10
|
-
strategy:
|
11
|
-
matrix:
|
12
|
-
experimental: [false]
|
13
|
-
|
14
|
-
os:
|
15
|
-
- ubuntu
|
16
|
-
- macos
|
17
|
-
|
18
|
-
ruby:
|
19
|
-
- 2.5
|
20
|
-
- 2.6
|
21
|
-
- 2.7
|
22
|
-
|
23
|
-
include:
|
24
|
-
- experimental: true
|
25
|
-
os: ubuntu
|
26
|
-
ruby: truffleruby
|
27
|
-
- experimental: true
|
28
|
-
os: ubuntu
|
29
|
-
ruby: jruby
|
30
|
-
- experimental: true
|
31
|
-
os: ubuntu
|
32
|
-
ruby: head
|
33
|
-
- experimental: true
|
34
|
-
os: ubuntu
|
35
|
-
ruby: 2.6
|
36
|
-
env: COVERAGE=PartialSummary,Coveralls
|
37
|
-
|
38
|
-
steps:
|
39
|
-
- uses: actions/checkout@v1
|
40
|
-
- uses: ruby/setup-ruby@v1
|
41
|
-
with:
|
42
|
-
ruby-version: ${{matrix.ruby}}
|
43
|
-
|
44
|
-
- name: Installing packages (ubuntu)
|
45
|
-
if: matrix.os == 'ubuntu'
|
46
|
-
run: sudo apt-get install apache2-utils
|
47
|
-
|
48
|
-
- name: Install dependencies
|
49
|
-
run: ${{matrix.env}} bundle install
|
50
|
-
|
51
|
-
- name: Run tests
|
52
|
-
run: ${{matrix.env}} bundle exec rspec
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
dist: xenial
|
3
|
-
cache: bundler
|
4
|
-
|
5
|
-
addons:
|
6
|
-
apt:
|
7
|
-
packages:
|
8
|
-
- wrk
|
9
|
-
- apache2-utils
|
10
|
-
homebrew:
|
11
|
-
packages:
|
12
|
-
- wrk
|
13
|
-
|
14
|
-
script: bundle exec rspec
|
15
|
-
|
16
|
-
matrix:
|
17
|
-
include:
|
18
|
-
- rvm: 2.5
|
19
|
-
- rvm: 2.6
|
20
|
-
- rvm: 2.7
|
21
|
-
- rvm: 2.6
|
22
|
-
env: COVERAGE=PartialSummary,Coveralls
|
23
|
-
- rvm: truffleruby
|
24
|
-
- rvm: jruby-head
|
25
|
-
env: JRUBY_OPTS="--debug -X+O"
|
26
|
-
- rvm: ruby-head
|
27
|
-
- rvm: 2.7
|
28
|
-
os: osx
|
29
|
-
allow_failures:
|
30
|
-
- rvm: ruby-head
|
31
|
-
- rvm: jruby-head
|
32
|
-
- rvm: truffleruby
|
33
|
-
|
34
|
-
# after_success:
|
35
|
-
# - bundle exec rake h2spec:all
|