async-http 0.45.3 → 0.45.4
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/async-http.gemspec +1 -1
- data/lib/async/http/protocol/http2/client.rb +0 -10
- data/lib/async/http/protocol/http2/connection.rb +5 -3
- data/lib/async/http/protocol/http2/request.rb +7 -3
- data/lib/async/http/protocol/http2/response.rb +1 -1
- data/lib/async/http/protocol/http2/server.rb +1 -1
- data/lib/async/http/protocol/http2/stream.rb +15 -9
- data/lib/async/http/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af620d4e3e885af7b094634cd875459b5613999af8b80464dc52fbc92108d7cb
|
4
|
+
data.tar.gz: a56bea4149a58c74f2830d31f62ef308720a51887574aab81087ebfb095502f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16bd6f0a463a8fe62e14054fc9918df817a7937f7a172b9c4d5266e588143db6c86ea3d34b83e89dbf77bfe3fc0be3e76cb1b0e0a60e73f6620a251e5768caca
|
7
|
+
data.tar.gz: bdce788539eab5560fb489b7ff9d631218f5fdbaf0c0602d8b054b9bbc43cea6743897c73ff332abd8138fb5e41e711539f96308291d9da6885dc3b291d14cfb
|
data/async-http.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
spec.add_dependency("protocol-http", "~> 0.8.0")
|
23
23
|
spec.add_dependency("protocol-http1", "~> 0.8.0")
|
24
|
-
spec.add_dependency("protocol-http2", "~> 0.
|
24
|
+
spec.add_dependency("protocol-http2", "~> 0.6.0")
|
25
25
|
|
26
26
|
# spec.add_dependency("openssl")
|
27
27
|
|
@@ -42,16 +42,6 @@ module Async
|
|
42
42
|
Response.new(self, self.next_stream_id)
|
43
43
|
end
|
44
44
|
|
45
|
-
def stop_connection(error)
|
46
|
-
super
|
47
|
-
|
48
|
-
@streams.each do |id, stream|
|
49
|
-
if stream.respond_to?(:stop_connection)
|
50
|
-
stream.stop_connection(error)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
45
|
# Used by the client to send requests to the remote server.
|
56
46
|
def call(request)
|
57
47
|
raise ::Protocol::HTTP2::Error, "Connection closed!" if self.closed?
|
@@ -61,8 +61,10 @@ module Async
|
|
61
61
|
@reader ||= read_in_background
|
62
62
|
end
|
63
63
|
|
64
|
-
def
|
64
|
+
def close(error = nil)
|
65
65
|
@reader = nil
|
66
|
+
|
67
|
+
super
|
66
68
|
end
|
67
69
|
|
68
70
|
def write_frame(frame)
|
@@ -81,9 +83,9 @@ module Async
|
|
81
83
|
self.read_frame
|
82
84
|
end
|
83
85
|
rescue EOFError, Async::Wrapper::Cancelled
|
84
|
-
#
|
86
|
+
# Ignore.
|
85
87
|
ensure
|
86
|
-
|
88
|
+
close($!)
|
87
89
|
end
|
88
90
|
end
|
89
91
|
end
|
@@ -58,6 +58,13 @@ module Async
|
|
58
58
|
def close!
|
59
59
|
end
|
60
60
|
|
61
|
+
def stream_closed(error)
|
62
|
+
if @input
|
63
|
+
@input.close(error)
|
64
|
+
@input = nil
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
61
68
|
# @return [Stream] the promised stream, on which to send data.
|
62
69
|
def push(path, headers = nil)
|
63
70
|
push_headers = [
|
@@ -134,9 +141,6 @@ module Async
|
|
134
141
|
def receive_reset_stream(stream, error_code)
|
135
142
|
end
|
136
143
|
|
137
|
-
def stop_connection(error)
|
138
|
-
end
|
139
|
-
|
140
144
|
NO_RESPONSE = [
|
141
145
|
[STATUS, '500'],
|
142
146
|
]
|
@@ -30,9 +30,13 @@ module Async
|
|
30
30
|
|
31
31
|
@delegate = delegate
|
32
32
|
|
33
|
-
|
33
|
+
# This is the body that is being sent.
|
34
|
+
@body = nil
|
35
|
+
|
36
|
+
# The remainder of the current chunk being sent.
|
34
37
|
@remainder = nil
|
35
38
|
|
39
|
+
# The task that is handling sending the body.
|
36
40
|
@task = nil
|
37
41
|
end
|
38
42
|
|
@@ -47,12 +51,6 @@ module Async
|
|
47
51
|
@delegate.accept_push_promise_stream(headers, stream_id)
|
48
52
|
end
|
49
53
|
|
50
|
-
def close!
|
51
|
-
super
|
52
|
-
|
53
|
-
@delegate.close!
|
54
|
-
end
|
55
|
-
|
56
54
|
def send_body(body, task: Async::Task.current)
|
57
55
|
# TODO Might need to stop this task when body is cancelled.
|
58
56
|
@task = task.async do |subtask|
|
@@ -142,13 +140,21 @@ module Async
|
|
142
140
|
return error_code
|
143
141
|
end
|
144
142
|
|
145
|
-
def
|
143
|
+
def close!
|
144
|
+
@delegate.close!
|
145
|
+
|
146
|
+
super
|
147
|
+
end
|
148
|
+
|
149
|
+
def close(error = nil)
|
150
|
+
super
|
151
|
+
|
146
152
|
if @body
|
147
153
|
@body.close(error)
|
148
154
|
@body = nil
|
149
155
|
end
|
150
156
|
|
151
|
-
@delegate.
|
157
|
+
@delegate.stream_closed(error)
|
152
158
|
end
|
153
159
|
end
|
154
160
|
end
|
data/lib/async/http/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.45.
|
4
|
+
version: 0.45.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.6.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.6.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: async-rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|