falcon 0.17.5 → 0.17.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/falcon/adapters/input.rb +8 -2
- data/lib/falcon/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: a9bcaef685cba594d33df1f726e788447663d585c95840f6c45d3aacab44384d
|
4
|
+
data.tar.gz: ef29a6b370c8ac8266b9f3023ed540b8ee465681450f745ccf62ce55d5d22903
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3d6dc2b5bc6e1281f7a0214ba87b16146876ab99696b944951614e6b4dc37d492c1ad0c208be1fd94e7453a5691f8a77e6a4c8e63618d9911a3a8fc116fa616
|
7
|
+
data.tar.gz: 37940a74c4e5c066e78c66c734f518de4fb5534f86593e161d040d4d0127c6b7ed2587d40252c53147dec6b8f45cce6df8530c7fd70f1a910c53f29abad5b69f
|
@@ -18,6 +18,8 @@
|
|
18
18
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
19
|
# THE SOFTWARE.
|
20
20
|
|
21
|
+
require 'async/io/buffer'
|
22
|
+
|
21
23
|
require 'async/http/body'
|
22
24
|
require 'async/http/body/rewindable'
|
23
25
|
|
@@ -67,7 +69,7 @@ module Falcon
|
|
67
69
|
# @param buffer [String] the buffer which will receive the data
|
68
70
|
# @return a buffer containing the data
|
69
71
|
def read(length = nil, buffer = nil)
|
70
|
-
buffer ||= Async::IO::
|
72
|
+
buffer ||= Async::IO::Buffer.new
|
71
73
|
buffer.clear
|
72
74
|
|
73
75
|
until buffer.bytesize == length
|
@@ -77,8 +79,12 @@ module Falcon
|
|
77
79
|
remaining_length = length - buffer.bytesize if length
|
78
80
|
|
79
81
|
if remaining_length && remaining_length < @buffer.bytesize
|
82
|
+
# We know that we are not going to reuse the original buffer.
|
83
|
+
# But byteslice will generate a hidden copy. So let's freeze it first:
|
84
|
+
@buffer.freeze
|
85
|
+
|
80
86
|
buffer << @buffer.byteslice(0, remaining_length)
|
81
|
-
@buffer = @buffer.byteslice(remaining_length
|
87
|
+
@buffer = @buffer.byteslice(remaining_length, @buffer.bytesize)
|
82
88
|
else
|
83
89
|
buffer << @buffer
|
84
90
|
@buffer = nil
|
data/lib/falcon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: falcon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.6
|
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-07-
|
11
|
+
date: 2018-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-io
|