arachni-reactor 0.1.1 → 0.1.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
  SHA1:
3
- metadata.gz: 6c421c44ae454d55db1adc102b4c9d0819375ff0
4
- data.tar.gz: b05b9f1ddf6048d8e0df60684b738e879628e48c
3
+ metadata.gz: 2dd8da14a563d174b01b3ec556dc10b17bf7212a
4
+ data.tar.gz: a554df83d1fdec6fb709179fa11947c343d24f0b
5
5
  SHA512:
6
- metadata.gz: 83ba17f94bed4e8d8d8b6125ed06288051a3bc59bd34733f355db80757e01f65d7074459670c1cedb95ffc2c0242dfc8219ea4988199f5fb0c63139152e6182c
7
- data.tar.gz: e7a6690fa5d3c8f496e19a34e6d7d942548dc5dbb3ef62905a1e2c7a29c9fbd5b3923527ad2cf60c3ed707666ec6854577f6e135ef30eabe87ca9d3db50b18ec
6
+ metadata.gz: c2e868cd76cea63175be7f8675a1b3f7fc293c58994a5875ca2e6923d98fafb500d70ba547f9f14a5c330bb468c71630fe2c1d1f6dbb8179f86a53228b74a495
7
+ data.tar.gz: cf5a704e69e255edc2f54ddaef55a56003b9f70d88f33bc270392afed13ecb1563bdc2563a41bf696e0d45bcfc4a09708b61a55fce4c7a79645ddf534c456cad
@@ -1,5 +1,10 @@
1
1
  # ChangeLog
2
2
 
3
+ ## Version 0.1.2
4
+
5
+ - `Reactor` -- Reduced object allocations.
6
+ - `Connection::Error.translate` -- Handle `Errno::ENOTSOCK` errors.
7
+
3
8
  ## Version 0.1.1
4
9
 
5
10
  - `Connection`
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # License
2
2
 
3
- Copyright (C) 2014-2016, Tasos Laskos <tasos.laskos@gmail.com>
3
+ Copyright (C) 2014-2017, Sarosys LLC <http://www.sarosys.com/>
4
4
  All rights reserved.
5
5
 
6
6
  Redistribution and use in source and binary forms, with or without modification,
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <table>
4
4
  <tr>
5
5
  <th>Version</th>
6
- <td>0.1.1</td>
6
+ <td>0.1.2</td>
7
7
  </tr>
8
8
  <tr>
9
9
  <th>Github page</th>
@@ -23,7 +23,7 @@
23
23
  </tr>
24
24
  <tr>
25
25
  <th>Copyright</th>
26
- <td>2014-2016</td>
26
+ <td>2014-2017 <a href="http://www.sarosys.com">Sarosys LLC</a></td>
27
27
  </tr>
28
28
  <tr>
29
29
  <th>License</th>
@@ -692,24 +692,28 @@ class Reactor
692
692
  # @return [Array<Socket>]
693
693
  # Sockets of all connections, we want to be ready to read at any time.
694
694
  def read_sockets
695
- @connections.map do |_, connection|
695
+ s = []
696
+ @connections.each do |_, connection|
696
697
  next if !connection.listener? && !connection.connected?
697
- connection.socket
698
- end.compact
699
- end
700
-
701
- def all_sockets
702
- @connections.values.map(&:socket)
698
+ s << connection.socket
699
+ end
700
+ s
703
701
  end
704
702
 
705
703
  # @return [Array<Socket>]
706
704
  # Sockets of connections with
707
705
  # {Connection#has_outgoing_data? outgoing data}.
708
706
  def write_sockets
709
- @connections.map do |_, connection|
707
+ s = []
708
+ @connections.each do |_, connection|
710
709
  next if connection.connected? && !connection.has_outgoing_data?
711
- connection.socket
712
- end.compact
710
+ s << connection.socket
711
+ end
712
+ s
713
+ end
714
+
715
+ def all_sockets
716
+ @connections.values.map(&:socket)
713
717
  end
714
718
 
715
719
  def connections_from_sockets( sockets )
@@ -24,7 +24,7 @@ class Error < Arachni::Reactor::Error
24
24
  # @param [Block] block Block to run.
25
25
  def translate( &block )
26
26
  block.call
27
- rescue IOError, Errno::ENOTCONN => e
27
+ rescue IOError, Errno::ENOTCONN, Errno::ENOTSOCK => e
28
28
  raise_with_proper_backtrace( e, Closed )
29
29
  rescue SocketError, Errno::ENOENT => e
30
30
  raise_with_proper_backtrace( e, HostNotFound )
@@ -9,7 +9,7 @@
9
9
  module Arachni
10
10
  class Reactor
11
11
 
12
- VERSION = '0.1.1'
12
+ VERSION = '0.1.2'
13
13
 
14
14
  end
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arachni-reactor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tasos Laskos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-26 00:00:00.000000000 Z
11
+ date: 2017-01-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  Arachni::Reactor is a simple, lightweight, pure-Ruby implementation of the Reactor