async-io 1.8.1 → 1.8.2

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: a8d2a5bb8ab12fac26be40774eb239426d8533b68b42d95866884e03fda6e824
4
- data.tar.gz: 1cf9d4063d70649b936354195b83bd25eb49ff53b7a76d33178d2b80269cd319
3
+ metadata.gz: f7f9fd0c7ac3d55909e9d49bdefffadcb95fa6d22cce97266aa806cdedf8e42d
4
+ data.tar.gz: 46436128ec03245e175cc16b50b549b0aaaef7855136ee43fabc9ee9fe5cba0a
5
5
  SHA512:
6
- metadata.gz: 7b58035212d0d4b063e5c511bfce3ded7f02e5e8524e4b0c47d2e654ca447d92f8f65441cd5ab577c413eacfff71e3ec1dd26c224fd72bf18decc00fcd791334
7
- data.tar.gz: 3570983e37a2d827b5ead5bc7d0c2b36a2522bb95241ec54334923e999d2a51ec3829649ccd8eae9af1a501695d5f11c9b1d1469f0bb04508a5ccb2b4a0be938
6
+ metadata.gz: b72f1b1a7de4fc5a3a8f597ab6f82ae1bda12b83ea2873e0f2c271660eddba1cecafe59de190e647936e7e0a272ceedef5541817ed2136927cb327b56324afc5
7
+ data.tar.gz: 2bac9e1ede1b00f5b2a614c270f6b2a609acc1108fc25b0a0e48288e9507bf95f9b72d5526bb6df7db028147ab03ba4ba8d1700dbc792fb1391021f1b3641acc
@@ -73,11 +73,11 @@ module Async
73
73
  end
74
74
 
75
75
  def self.wrap(socket, context)
76
- io = @wrapped_klass.new(socket.to_io, context)
77
-
78
76
  # We detach the socket from the reactor, otherwise it's possible to add the file descriptor to the selector twice, which is bad.
79
77
  socket.reactor = nil
80
78
 
79
+ io = @wrapped_klass.new(socket.to_io, context)
80
+
81
81
  # This ensures that when the internal IO is closed, it also closes the internal socket:
82
82
  io.sync_close = true
83
83
 
@@ -158,17 +158,16 @@ module Async
158
158
 
159
159
  # Fills the buffer from the underlying stream.
160
160
  def fill_read_buffer
161
- Async.logger.debug(self){"fill_read_buffer..."}
162
-
163
161
  # Can we read directly into the buffer? (Ruby doesn't support append, only replace):
164
- if chunk = @io.read(@block_size)
165
- Async.logger.debug(self){"@io.read -> #{chunk.size} bytes"}
162
+ if @read_buffer.empty?
163
+ if @io.read(@block_size, @read_buffer)
164
+ return true
165
+ end
166
+ elsif chunk = @io.read(@block_size)
166
167
  @read_buffer << chunk
167
168
  return true
168
169
  end
169
170
 
170
- Async.logger.debug(self){"@io.read -> #{chunk.inspect}"}
171
-
172
171
  # We didn't read anything, so we must be at eof:
173
172
  @eof = true
174
173
  return false
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module IO
23
- VERSION = "1.8.1"
23
+ VERSION = "1.8.2"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-io
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams