rex-socket 0.1.47 → 0.1.49

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: ee17c01e1a4f7063f35a53e7bd069d772eb16499c796e566e59172c862ebe2f0
4
- data.tar.gz: 95cec06b282479a208a793e572b312fdec938733c31ac39c11a35d4093ab6647
3
+ metadata.gz: 3094879e49eec452993a7285a7423c92f80750e21482c93f1161a9863bc63b35
4
+ data.tar.gz: 8948da7edd9356d433f41661b25edab5e4af5a86c7156f5f8f9c198c1edccd0a
5
5
  SHA512:
6
- metadata.gz: 194008d3f56ce2ed0a2f3472a2de73cc5f3d297ef8ff183ce1e9a380319356752c882171112b20b9edb75e44e52b644651e0bad3faabddfb158911175cd38d32
7
- data.tar.gz: 766bf3d2c08fcf411aa8cc0a8137e4a140066bf730d606ba154d2e22c7da01b149b91f0365eb5c6dbc3b557b80e52661d4bb0b3888510a1877d04c2693cba34c
6
+ metadata.gz: 6bc286aac40859d28d7b3c96544c0cc8794df9763c485533bd9f28174c872db0d3919a632a7fd9ae71a97178b2e2a8a8d660467a3833384f820dc8b81ef1d0ec
7
+ data.tar.gz: aa991acb7049aa46d2d57fcaf8ee17a42f4a8fd2fee04e485e732a3451dd54c1d36a17fbe74c794d4903b61fd55a30b4de558e88a72b6a55ed72cf7f92b8a2cd
checksums.yaml.gz.sig CHANGED
Binary file
@@ -540,8 +540,11 @@ end
540
540
  class Host < Range
541
541
  attr_accessor :hostname
542
542
 
543
- def initialize(address, hostname=nil, options=nil)
544
- address = Rex::Socket.addr_atoi(address) if address.is_a? String
543
+ def initialize(address, hostname=nil, options={})
544
+ if address.is_a? String
545
+ options.merge!({ ipv6: Rex::Socket.is_ipv6?(address) }) if options[:ipv6].nil?
546
+ address = Rex::Socket.addr_atoi(address)
547
+ end
545
548
 
546
549
  super(address, address, options)
547
550
  @hostname = hostname
@@ -234,6 +234,29 @@ begin
234
234
  total_sent
235
235
  end
236
236
 
237
+ #
238
+ # Polls the stream to see if there is any read data available. Returns
239
+ # true if data is available for reading, otherwise false is returned.
240
+ #
241
+ def has_read_data?(timeout = nil)
242
+ return true if self.sslsock.pending > 0
243
+
244
+ # Allow a timeout of "0" that waits almost indefinitely for input, this
245
+ # mimics the behavior of Rex::ThreadSafe.select() and fixes some corner
246
+ # cases of unintentional no-wait timeouts.
247
+ timeout = 3600 if (timeout and timeout == 0)
248
+
249
+ begin
250
+ s = Rex::ThreadSafe.select( [ self.sslsock ], nil, nil, timeout )
251
+ return !( s == nil || s[0] == nil )
252
+ rescue ::Errno::EBADF, ::Errno::ENOTSOCK
253
+ raise ::EOFError
254
+ rescue StreamClosedError, ::IOError, ::EOFError, ::Errno::EPIPE
255
+ # Return false if the socket is dead
256
+ return false
257
+ end
258
+ end
259
+
237
260
  #
238
261
  # Reads data from the SSL socket.
239
262
  #
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Socket
3
- VERSION = "0.1.47"
3
+ VERSION = "0.1.49"
4
4
  end
5
5
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rex-socket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.47
4
+ version: 0.1.49
5
5
  platform: ruby
6
6
  authors:
7
7
  - Metasploit Hackers
@@ -93,7 +93,7 @@ cert_chain:
93
93
  EknWpNgVhohbot1lfVAMmIhdtOVaRVcQQixWPwprDj/ydB8ryDMDosIMcw+fkoXU
94
94
  9GJsSaSRRYQ9UUkVL27b64okU8D48m8=
95
95
  -----END CERTIFICATE-----
96
- date: 2023-02-06 00:00:00.000000000 Z
96
+ date: 2023-03-23 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
metadata.gz.sig CHANGED
Binary file