falcon 0.15.1 → 0.15.2
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 +19 -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: 682a4983771c1015ffd59ff7d241109f598fadfed95db19bfb418e9149d9e4a4
|
4
|
+
data.tar.gz: '081b506a5324694090bfb87020711761b732aff8f860d1dbe4f606a0f405d157'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32491eb4950dc9667a63fc075242e778cd2bb5725da0eb9fd52d399585a8072d9ab505ab2de4c02521d1098295816875145a0dca990c04e062eb7ddd09de4dfc
|
7
|
+
data.tar.gz: df2a3b8800e5fa83ad8d27f5a0f6e282f7a140b046e0c552a7b308b5ab4ae47fc3ff20a5894ee14f45189867ab8a823554c806f71733c9639d942e984b3a4180
|
@@ -48,15 +48,32 @@ module Falcon
|
|
48
48
|
@buffer.clear
|
49
49
|
end
|
50
50
|
|
51
|
+
# Read some data from the underlying body. Similar to `IO#read`.
|
52
|
+
# @param length [Integer] the amount of data to read
|
53
|
+
# @param buffer [String] the buffer which will receive the data
|
54
|
+
# @return a buffer containing the data
|
51
55
|
def read(length = nil, buffer = nil)
|
52
56
|
if length
|
53
57
|
fill_buffer(length) if @buffer.bytesize <= length
|
54
58
|
|
55
|
-
|
59
|
+
chunk = @buffer.slice!(0, length)
|
60
|
+
|
61
|
+
if buffer
|
62
|
+
# TODO https://bugs.ruby-lang.org/issues/14745
|
63
|
+
buffer.replace(chunk)
|
64
|
+
else
|
65
|
+
buffer = chunk
|
66
|
+
end
|
67
|
+
|
68
|
+
if buffer.empty? and length > 0
|
69
|
+
return nil
|
70
|
+
else
|
71
|
+
return buffer
|
72
|
+
end
|
56
73
|
else
|
57
74
|
buffer ||= Async::IO::BinaryString.new
|
58
75
|
|
59
|
-
buffer
|
76
|
+
buffer.replace(@buffer)
|
60
77
|
@buffer.clear
|
61
78
|
|
62
79
|
while chunk = read_next
|
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.15.
|
4
|
+
version: 0.15.2
|
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-06-
|
11
|
+
date: 2018-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-io
|