rxio 1.2.3 → 1.2.4

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
  SHA1:
3
- metadata.gz: e24aeca7703c5d851ab242ab2aeadbed4e1579b3
4
- data.tar.gz: 03a7d32a082ace38d4019d44b7a7344d95012ea4
3
+ metadata.gz: 061b52b3f4d31432e5d37fe78588d6b611fb8f7a
4
+ data.tar.gz: 71a684798b57c87112b8e7b7d5211dfed3e2bc33
5
5
  SHA512:
6
- metadata.gz: c4640365e17cea559ba9ab0fe16ac03f5813ab6db0fb143babcaf9ac5e6dc38f8e27d5a73050a3f08dee220926f0828cb4e150e53a8bb9bcb84f857f916e9f65
7
- data.tar.gz: 576fc4737f981da5bb9a0a7f9245d775248745f2a3a91bda7fba3e510f9e6f364137cc9bd1389357058235f5abf523fa995707ba289615e6ee42337fcc6c5bb4
6
+ metadata.gz: 2165483d9a090954fc497b3337cf4b2c176e975634319baabe67ea0a5ecde447dcd29b3ce2b4ca12cbb478eefacedebc6f6a350138782faa1b171bf8e776175e
7
+ data.tar.gz: 528ab8ffb45bff289391c7b735b239112b77cff431f0ff9b032de426d1bf8226092adc003a807ff36f0ca164e3a18e2a07bc9532def20d49418d7e9048176ffe
data/lib/rxio/io_base.rb CHANGED
@@ -10,6 +10,12 @@ module RxIO
10
10
  # Chunk Size
11
11
  CHUNK_SIZE = 1024
12
12
 
13
+ # Retry Exceptions
14
+ RETRY_EXCEPTIONS = [
15
+ OpenSSL::SSL::SSLErrorWaitReadable,
16
+ IO::EAGAINWaitReadable
17
+ ]
18
+
13
19
  # Process Input:
14
20
  # Processes Input for an Endpoint, in the form of a data chunk.
15
21
  # @param [Hash] endpoint
@@ -51,16 +57,18 @@ module RxIO
51
57
  # Therefore we loop until we either have an explicit error or a signal to wait.
52
58
  done = false
53
59
  chunk = ''
60
+ rdstr = ''
54
61
  until done || !chunk
55
62
  begin
56
- chunk << s.read_nonblock(CHUNK_SIZE)
63
+ rdstr = s.read_nonblock(CHUNK_SIZE)
64
+ chunk << rdstr if rdstr
57
65
  rescue Exception => ex
58
- if ex.is_a? OpenSSL::SSL::SSLErrorWaitReadable; then done = true; else chunk = nil; end
66
+ if RETRY_EXCEPTIONS.include? ex.class; then done = true; else rdstr = nil; end
59
67
  end
60
68
  end
61
69
 
62
70
  # Drop Endpoint & Abort on Error
63
- return drop_endpoint e unless chunk
71
+ return drop_endpoint e unless rdstr
64
72
 
65
73
  # Process Input
66
74
  process_input e, chunk
data/lib/rxio/version.rb CHANGED
@@ -5,5 +5,5 @@
5
5
  module RxIO
6
6
 
7
7
  # Version
8
- VERSION = '1.2.3'
8
+ VERSION = '1.2.4'
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rxio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eresse