async-http 0.27.3 → 0.27.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/async/http/protocol/http11.rb +14 -6
- data/lib/async/http/protocol/http2.rb +1 -1
- data/lib/async/http/response.rb +4 -0
- data/lib/async/http/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6fe0971913f89e9ebd68515c2e93ae525757490c52d36ab1b28a6ecc6f1257f
|
4
|
+
data.tar.gz: aa2e52fada5c8e31e634d40f84eca6fe4f4fa604eb7eeb220e7b020a8fdeb4cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44a409a36d515ff781392703c8daa76984f02f56ff6860f86939fa8740adf940d9ac313a2b5436afc3939e4162c46fd56c7e19518071992b9637d3bac703cd92
|
7
|
+
data.tar.gz: b4b2869437271dda4f1dbf748c852fd6ac8d4f0e2e1aa3e3c495601a25e9fdf121562325c61436b2ca1de3a92551437e3403409a028a7373e7ab722f41838c72
|
@@ -85,6 +85,7 @@ module Async
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
+
# @return [Async::Wrapper] the underlying non-blocking IO.
|
88
89
|
def hijack
|
89
90
|
@persistent = false
|
90
91
|
|
@@ -130,15 +131,22 @@ module Async
|
|
130
131
|
# Server loop.
|
131
132
|
def receive_requests(task: Task.current)
|
132
133
|
while request = next_request
|
133
|
-
|
134
|
+
response = yield(request, self)
|
135
|
+
|
136
|
+
return if @stream.closed?
|
137
|
+
|
138
|
+
if response
|
134
139
|
write_response(self.version, response.status, response.headers, response.body)
|
135
|
-
request.finish
|
136
|
-
|
137
|
-
# This ensures we yield at least once every iteration of the loop and allow other fibers to execute.
|
138
|
-
task.yield
|
139
140
|
else
|
140
|
-
|
141
|
+
# If the request failed to generate a response, it was an internal server error:
|
142
|
+
write_response(self.version, 500, {}, nil)
|
141
143
|
end
|
144
|
+
|
145
|
+
# Gracefully finish reading the request body if it was not already done so.
|
146
|
+
request.finish
|
147
|
+
|
148
|
+
# This ensures we yield at least once every iteration of the loop and allow other fibers to execute.
|
149
|
+
task.yield
|
142
150
|
end
|
143
151
|
end
|
144
152
|
|
data/lib/async/http/response.rb
CHANGED
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.27.
|
4
|
+
version: 0.27.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|