async-http 0.50.10 → 0.50.11
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e2683450493f7798b19ba771062b9667d36908537c4436612dbef9258161414
|
4
|
+
data.tar.gz: f81544074c92e4a243af4dc951bf5d964d4aba9cc65d41522af036c0996df8b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2f5d961735d863b384f0ce5fdbb725db03100b9e4c63745a5b24284847ed7ca1f3fe78007edaaa176ab9a0719ce79c0fce782b0702adcf6c2476ef446e3cc4f
|
7
|
+
data.tar.gz: 0d8994218cae5d726d355fd7a7a4b4c7b2034d8b35e561c0eff75e28e8ff095c11aefff2dd499ad2b5ecfad418707ba0917c0ddfd297405a84ebd78b15c7a3dd
|
data/lib/async/http/body/pipe.rb
CHANGED
@@ -22,21 +22,18 @@
|
|
22
22
|
|
23
23
|
require_relative 'writable'
|
24
24
|
|
25
|
-
require 'forwardable'
|
26
|
-
|
27
25
|
module Async
|
28
26
|
module HTTP
|
29
27
|
module Body
|
30
28
|
class Pipe
|
31
|
-
|
32
|
-
|
29
|
+
# If the input stream is closed first, it's likely the output stream will also be closed.
|
33
30
|
def initialize(input, output = Writable.new, task: Task.current)
|
34
31
|
@input = input
|
35
32
|
@output = output
|
36
33
|
|
37
34
|
head, tail = IO::Socket.pair(Socket::AF_UNIX, Socket::SOCK_STREAM)
|
38
35
|
|
39
|
-
@head =
|
36
|
+
@head = IO::Stream.new(head)
|
40
37
|
@tail = tail
|
41
38
|
|
42
39
|
@reader = nil
|
@@ -90,6 +87,7 @@ module Async
|
|
90
87
|
end
|
91
88
|
ensure
|
92
89
|
@writer = nil
|
90
|
+
|
93
91
|
@output.close($!)
|
94
92
|
|
95
93
|
@head.close if @reader.nil?
|
@@ -92,9 +92,9 @@ module Async
|
|
92
92
|
@stream.flush
|
93
93
|
end
|
94
94
|
|
95
|
-
def read_in_background(
|
96
|
-
|
97
|
-
|
95
|
+
def read_in_background(parent: Task.current)
|
96
|
+
parent.async do |task|
|
97
|
+
task.annotate("#{version} reading data for #{self.class}.")
|
98
98
|
|
99
99
|
begin
|
100
100
|
while !self.closed?
|
@@ -104,7 +104,10 @@ module Async
|
|
104
104
|
rescue IOError, EOFError, Errno::ECONNRESET, Errno::EPIPE, Async::Wrapper::Cancelled
|
105
105
|
# Ignore.
|
106
106
|
ensure
|
107
|
-
close
|
107
|
+
# Don't call #close twice.
|
108
|
+
if @reader
|
109
|
+
self.close($!)
|
110
|
+
end
|
108
111
|
end
|
109
112
|
end
|
110
113
|
end
|
@@ -71,10 +71,15 @@ module Async
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
+
# This method should only be called from within the context of the output task.
|
74
75
|
def close(error = nil)
|
75
|
-
@stream
|
76
|
+
if @stream
|
77
|
+
@stream.finish_output(error)
|
78
|
+
@stream = nil
|
79
|
+
end
|
76
80
|
end
|
77
81
|
|
82
|
+
# This method should only be called from within the context of the HTTP/2 stream.
|
78
83
|
def stop(error)
|
79
84
|
@task&.stop
|
80
85
|
@task = nil
|
@@ -103,7 +108,7 @@ module Async
|
|
103
108
|
# GC.start
|
104
109
|
end
|
105
110
|
|
106
|
-
|
111
|
+
self.close
|
107
112
|
ensure
|
108
113
|
@body&.close($!)
|
109
114
|
@body = nil
|
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.50.
|
4
|
+
version: 0.50.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -284,7 +284,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
284
284
|
- !ruby/object:Gem::Version
|
285
285
|
version: '0'
|
286
286
|
requirements: []
|
287
|
-
rubygems_version: 3.
|
287
|
+
rubygems_version: 3.1.2
|
288
288
|
signing_key:
|
289
289
|
specification_version: 4
|
290
290
|
summary: A HTTP client and server library.
|