async-http 0.37.9 → 0.37.10
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/lib/async/http/protocol/http2/client.rb +8 -0
- data/lib/async/http/protocol/http2/connection.rb +3 -5
- data/lib/async/http/protocol/http2/request.rb +3 -0
- data/lib/async/http/protocol/http2/response.rb +6 -0
- data/lib/async/http/protocol/http2/server.rb +1 -1
- data/lib/async/http/protocol/http2/stream.rb +9 -0
- data/lib/async/http/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4580a8fa7e52098d4802b4545e6bf9c751f4b2355bbc6c526ccafd054cf722b3
|
4
|
+
data.tar.gz: 24eefee5a18a5c24e80fc8c36457b2e74dcdbe69547c6781ffa13653a34e10b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e3ec117d299fd45460e736b27c9af3b607aabf9b2057d11c3f18d525547308cb0b22965ecd9f97fef885bd3d1c44626012eeb2fe127b6b7d43f248145447600
|
7
|
+
data.tar.gz: 76b16ae1efcbc1e3089ebd6e07d7f612dda1b0dfe89e93a851b8256356ab137709ea95c4e5653c53de20b9b7b1c015dbe25c8d715b5a9701f2f331ea91e84ca4
|
@@ -38,6 +38,14 @@ module Async
|
|
38
38
|
super(framer)
|
39
39
|
end
|
40
40
|
|
41
|
+
def stop_connection(error)
|
42
|
+
super
|
43
|
+
|
44
|
+
@streams.each do |id, stream|
|
45
|
+
stream.stop_connection(error)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
41
49
|
# Used by the client to send requests to the remote server.
|
42
50
|
def call(request)
|
43
51
|
@count += 1
|
@@ -49,23 +49,21 @@ module Async
|
|
49
49
|
@reader ||= read_in_background
|
50
50
|
end
|
51
51
|
|
52
|
-
def stop_connection
|
52
|
+
def stop_connection(error)
|
53
53
|
@reader = nil
|
54
54
|
end
|
55
55
|
|
56
56
|
def read_in_background(task: Task.current)
|
57
57
|
task.async do |nested_task|
|
58
|
-
nested_task.annotate("#{version} reading data")
|
58
|
+
nested_task.annotate("#{version} reading data for #{self.class}")
|
59
59
|
|
60
60
|
begin
|
61
61
|
# Even thought the connection might be logically closed, we are not done until all HTTP/2 streams are closed or the underlying I/O is closed.
|
62
62
|
while !@stream.closed?
|
63
63
|
self.read_frame
|
64
64
|
end
|
65
|
-
rescue
|
66
|
-
Async.logger.debug(self) {$!}
|
67
65
|
ensure
|
68
|
-
stop_connection
|
66
|
+
stop_connection($!)
|
69
67
|
end
|
70
68
|
end
|
71
69
|
end
|
@@ -99,6 +99,12 @@ module Async
|
|
99
99
|
notify!
|
100
100
|
end
|
101
101
|
|
102
|
+
def stop_connection(error)
|
103
|
+
@exception = error
|
104
|
+
|
105
|
+
notify!
|
106
|
+
end
|
107
|
+
|
102
108
|
# Send a request and read it into this response.
|
103
109
|
def send_request(request)
|
104
110
|
# https://http2.github.io/http2-spec/#rfc.section.8.1.2.3
|
data/lib/async/http/version.rb
CHANGED