async-http 0.40.1 → 0.40.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/async-http.gemspec +1 -1
- data/lib/async/http/body/fixed.rb +0 -29
- data/lib/async/http/body/remainder.rb +56 -0
- data/lib/async/http/protocol/http1/connection.rb +1 -4
- data/lib/async/http/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d52ccd5014c47f8a71d2bc51494661234d5a51c6e48129dc30fcb00bed20fbfb
|
4
|
+
data.tar.gz: 7c25b371c99a7a02b5481c0552aa392e4218de84cfa6911fab4d0afb9f7e008a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d36812a4ee226de8d41c91b65a61faafbe174a121b6bc5b3524196844c8f360e3b880d7e802be8c54388346e069f69b035b109495f9820126a2d1d1136c28a3
|
7
|
+
data.tar.gz: 3c2993a11b3dc7bf01c2daf9f9810afe0698808e62044600af451c531281bb885d6c8e60c758334a1a2cd36481a2cacb2fa8ccac0305dc8d3abb96f593741cb7
|
data/async-http.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.add_dependency("async-io", "~> 1.18")
|
21
21
|
|
22
22
|
spec.add_dependency("protocol-http", "~> 0.3.0")
|
23
|
-
spec.add_dependency("protocol-http1", "~> 0.
|
23
|
+
spec.add_dependency("protocol-http1", "~> 0.4.0")
|
24
24
|
spec.add_dependency("protocol-http2", "~> 0.2.0")
|
25
25
|
|
26
26
|
# spec.add_dependency("openssl")
|
@@ -67,35 +67,6 @@ module Async
|
|
67
67
|
"\#<#{self.class} length=#{@length} remaining=#{@remaining}>"
|
68
68
|
end
|
69
69
|
end
|
70
|
-
|
71
|
-
class Remainder < Readable
|
72
|
-
def initialize(stream)
|
73
|
-
@stream = stream
|
74
|
-
end
|
75
|
-
|
76
|
-
def empty?
|
77
|
-
@stream.closed?
|
78
|
-
end
|
79
|
-
|
80
|
-
def close(error = nil)
|
81
|
-
# We can't really do anything in this case except close the connection.
|
82
|
-
@stream.close
|
83
|
-
|
84
|
-
super
|
85
|
-
end
|
86
|
-
|
87
|
-
def read
|
88
|
-
@stream.read_partial
|
89
|
-
end
|
90
|
-
|
91
|
-
def join
|
92
|
-
read
|
93
|
-
end
|
94
|
-
|
95
|
-
def inspect
|
96
|
-
"\#<#{self.class} #{@stream.closed? ? 'closed' : 'open'}>"
|
97
|
-
end
|
98
|
-
end
|
99
70
|
end
|
100
71
|
end
|
101
72
|
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in
|
11
|
+
# all copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
# THE SOFTWARE.
|
20
|
+
|
21
|
+
require_relative 'readable'
|
22
|
+
|
23
|
+
module Async
|
24
|
+
module HTTP
|
25
|
+
module Body
|
26
|
+
class Remainder < Readable
|
27
|
+
def initialize(stream)
|
28
|
+
@stream = stream
|
29
|
+
end
|
30
|
+
|
31
|
+
def empty?
|
32
|
+
@stream.closed?
|
33
|
+
end
|
34
|
+
|
35
|
+
def close(error = nil)
|
36
|
+
# We can't really do anything in this case except close the connection.
|
37
|
+
@stream.close
|
38
|
+
|
39
|
+
super
|
40
|
+
end
|
41
|
+
|
42
|
+
def read
|
43
|
+
@stream.read_partial
|
44
|
+
end
|
45
|
+
|
46
|
+
def join
|
47
|
+
read
|
48
|
+
end
|
49
|
+
|
50
|
+
def inspect
|
51
|
+
"\#<#{self.class} #{@stream.closed? ? 'closed' : 'open'}>"
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -25,6 +25,7 @@ require_relative 'response'
|
|
25
25
|
|
26
26
|
require_relative '../../body/chunked'
|
27
27
|
require_relative '../../body/fixed'
|
28
|
+
require_relative '../../body/remainder'
|
28
29
|
|
29
30
|
module Async
|
30
31
|
module HTTP
|
@@ -86,10 +87,6 @@ module Async
|
|
86
87
|
Body::Fixed.new(@stream, length)
|
87
88
|
end
|
88
89
|
|
89
|
-
def read_tunnel_body
|
90
|
-
read_remainder_body
|
91
|
-
end
|
92
|
-
|
93
90
|
def read_remainder_body
|
94
91
|
Body::Remainder.new(@stream)
|
95
92
|
end
|
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.40.
|
4
|
+
version: 0.40.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.4.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.4.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: protocol-http2
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -191,6 +191,7 @@ files:
|
|
191
191
|
- lib/async/http/body/inflate.rb
|
192
192
|
- lib/async/http/body/readable.rb
|
193
193
|
- lib/async/http/body/reader.rb
|
194
|
+
- lib/async/http/body/remainder.rb
|
194
195
|
- lib/async/http/body/rewindable.rb
|
195
196
|
- lib/async/http/body/slowloris.rb
|
196
197
|
- lib/async/http/body/stream.rb
|
@@ -251,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
251
252
|
- !ruby/object:Gem::Version
|
252
253
|
version: '0'
|
253
254
|
requirements: []
|
254
|
-
rubygems_version: 3.0.
|
255
|
+
rubygems_version: 3.0.2
|
255
256
|
signing_key:
|
256
257
|
specification_version: 4
|
257
258
|
summary: A HTTP client and server library.
|