async-http 0.12.0 → 0.13.0

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: 9f76d14d623f95c9f57dc60a00e2200e05214149eeb2625ff632d05492981183
4
- data.tar.gz: e9b9191121ca54563cae6090a28725bf00029eec28e914972f6e36d24b67b082
3
+ metadata.gz: ab2ed7709920b3e9cc8238a985394b70d551ccb48c6b96a56c2c792e8198c43b
4
+ data.tar.gz: bcf589caf131f60b2f5f03055405cca63dfc78454ec1cd53b4dd651f0fc53f31
5
5
  SHA512:
6
- metadata.gz: bcdeb04bb6666ed1ccbd04cf40ffa01b37e2c8e1899c109fdb654e9bb8eb5b88a150ecd1ddbd53500eff5915e505e2e54bff6f68566a4f15324a5d6cecfa1179
7
- data.tar.gz: 287f239b0e75d139c1e93f701365e7062d7e90a6c21912dd4b9d27b5d8c1211a12efcb349c0cf32de15ce04bee890a98efaf0d90d9e125415ec2eb1d6991d255
6
+ metadata.gz: 4758cfb15c4cf6d5a338a108952cb0d0a055c3f02158560b0c31153269ce08ae625de08432a2870a0e45efbd18a563c43ff21d79ea2355246e93154bd27dd548
7
+ data.tar.gz: de8a8ab4b60f5a27fe00c670e2f5e1a3a1588c0baef96288e85482ffe4ce2158a1fbf95f186ceb0cf89de5599b15eefa8dd6414519fd965830fbc1c5c82e2710
@@ -134,6 +134,10 @@ module Async
134
134
  end
135
135
 
136
136
  alias join read
137
+
138
+ def close
139
+ read
140
+ end
137
141
  end
138
142
  end
139
143
  end
@@ -72,6 +72,8 @@ module Async
72
72
 
73
73
  write_response(request.version, status, headers, body)
74
74
 
75
+ request.close
76
+
75
77
  unless keep_alive?(request.headers) and keep_alive?(headers)
76
78
  @keep_alive = false
77
79
 
@@ -195,15 +197,17 @@ module Async
195
197
  size = @protocol.read_line.to_i(16)
196
198
 
197
199
  if size == 0
198
- @closed = true
199
200
  @protocol.read_line
200
201
 
202
+ @closed = true
203
+
201
204
  return
202
205
  end
203
206
 
204
- yield @protocol.stream.read(size)
205
-
207
+ chunk = @protocol.stream.read(size)
206
208
  @protocol.read_line # Consume the trailing CRLF
209
+
210
+ yield chunk
207
211
  end
208
212
  end
209
213
 
@@ -216,6 +220,10 @@ module Async
216
220
 
217
221
  return buffer
218
222
  end
223
+
224
+ def close
225
+ self.each {}
226
+ end
219
227
  end
220
228
 
221
229
  def read_body(headers)
@@ -202,6 +202,7 @@ module Async
202
202
 
203
203
  stream.on(:close) do
204
204
  Async.logger.debug(self) {"Stream closed, sending signal."}
205
+ # TODO should we prefer response.close?
205
206
  response.body.close
206
207
  end
207
208
 
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module HTTP
23
- VERSION = "0.12.0"
23
+ VERSION = "0.13.0"
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.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams