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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d5710ca0e5393d6c5d440bc2bb6e075ca62cce760abe95d02e3b01ec2d79b58
4
- data.tar.gz: 652291cc7346026cd4a314f064399abcddd27a8bb8c7cc61d6f541eb7a38972c
3
+ metadata.gz: 4580a8fa7e52098d4802b4545e6bf9c751f4b2355bbc6c526ccafd054cf722b3
4
+ data.tar.gz: 24eefee5a18a5c24e80fc8c36457b2e74dcdbe69547c6781ffa13653a34e10b5
5
5
  SHA512:
6
- metadata.gz: 99039c2bb14d47197a5e827a73e80cce66c30b6366bcc67d2914685a6f4571c7467727c6e7d04ade97200c57eaf9a177066fe54344c469cf09fb2d38bbf804bd
7
- data.tar.gz: 003b897a551cd4626c26668b12e41e89242dfddf0b68c3a76612574feb34f4ce3366802a15b18f54a4f00a756d2bf4c897c2f32224cdf0a68af951c745524229
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
@@ -85,6 +85,9 @@ module Async
85
85
  def receive_reset_stream(stream, error_code)
86
86
  end
87
87
 
88
+ def stop_connection(error)
89
+ end
90
+
88
91
  NO_RESPONSE = [
89
92
  [STATUS, '500'],
90
93
  [REASON, "No response generated"]
@@ -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
@@ -48,7 +48,7 @@ module Async
48
48
  return request.stream
49
49
  end
50
50
 
51
- def stop_connection
51
+ def stop_connection(error)
52
52
  super
53
53
 
54
54
  @requests.enqueue nil
@@ -127,6 +127,15 @@ module Async
127
127
 
128
128
  return error_code
129
129
  end
130
+
131
+ def stop_connection(error)
132
+ if @body
133
+ @body.close(error)
134
+ @body = nil
135
+ end
136
+
137
+ delegate.stop_connection(error)
138
+ end
130
139
  end
131
140
  end
132
141
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module HTTP
23
- VERSION = "0.37.9"
23
+ VERSION = "0.37.10"
24
24
  end
25
25
  end
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.37.9
4
+ version: 0.37.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams