io-endpoint 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/io/endpoint/ssl_endpoint.rb +6 -0
- data/lib/io/endpoint/version.rb +1 -1
- data/lib/io/endpoint/wrapper.rb +2 -1
- data/lib/io/readable.rb +4 -12
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc53917d52f22c2f27d8f425313d347ee3383cd854970b68664f8b726ce85333
|
4
|
+
data.tar.gz: 439e9c04e2b44fe1168cb833ae30b1ad359b74c86e32f43c0922cd8ed3cecdea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83ade7682438701b33e2050a69cc38efa3be7fa9bc7f6113263217db12fda799949ba1e3caf894861352cfcc6fc29a987ec25bc253d6d9e78544f24f0f1de50a
|
7
|
+
data.tar.gz: d722a9f23ea072246edda82dbc7ce633dc65da9c865f5a1b5e1948ca148ccc438f53e45139870b4739e167db037d4dd11b36a0295851482ff3f5845eb584a42f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/io/endpoint/version.rb
CHANGED
data/lib/io/endpoint/wrapper.rb
CHANGED
data/lib/io/readable.rb
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
class IO
|
2
2
|
unless method_defined?(:readable?)
|
3
3
|
def readable?
|
4
|
-
|
5
|
-
|
6
|
-
return true
|
7
|
-
else
|
8
|
-
!self.eof?
|
9
|
-
end
|
4
|
+
# Do not call `eof?` here as it is not concurrency-safe and it can block.
|
5
|
+
!closed?
|
10
6
|
end
|
11
7
|
end
|
12
8
|
end
|
@@ -16,19 +12,15 @@ require 'socket'
|
|
16
12
|
class BasicSocket
|
17
13
|
unless method_defined?(:readable?)
|
18
14
|
def readable?
|
19
|
-
# Is it likely that the socket is still connected?
|
20
|
-
# May return false positive, but won't return false negative.
|
21
|
-
return false unless super
|
22
|
-
|
23
15
|
# If we can wait for the socket to become readable, we know that the socket may still be open.
|
24
|
-
result =
|
16
|
+
result = self.recv_nonblock(1, MSG_PEEK, exception: false)
|
25
17
|
|
26
18
|
# No data was available - newer Ruby can return nil instead of empty string:
|
27
19
|
return false if result.nil?
|
28
20
|
|
29
21
|
# Either there was some data available, or we can wait to see if there is data avaialble.
|
30
22
|
return !result.empty? || result == :wait_readable
|
31
|
-
rescue Errno::ECONNRESET
|
23
|
+
rescue Errno::ECONNRESET, IOError
|
32
24
|
# This might be thrown by recv_nonblock.
|
33
25
|
return false
|
34
26
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: io-endpoint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
38
38
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
39
39
|
-----END CERTIFICATE-----
|
40
|
-
date: 2024-04-
|
40
|
+
date: 2024-04-21 00:00:00.000000000 Z
|
41
41
|
dependencies: []
|
42
42
|
description:
|
43
43
|
email:
|
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
|
-
rubygems_version: 3.
|
84
|
+
rubygems_version: 3.3.7
|
85
85
|
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: Provides a separation of concerns interface for IO endpoints.
|
metadata.gz.sig
CHANGED
Binary file
|