snmp4em 1.1.5 → 1.1.6

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
- SHA1:
3
- metadata.gz: 7a0049dbb8877e5daaaab5141f6ba97d7a6fb97c
4
- data.tar.gz: a9faac10dcdef203d791aab883a7d90dc2ee661c
2
+ SHA256:
3
+ metadata.gz: 1fcda985f3fcfb3211c6de75baaef51802405047ac37c0e5223f5da628f0cd0e
4
+ data.tar.gz: 84067c9649b188ac4ede4d292667fbff5a30a3585649ad7bcb2deca6e02beef5
5
5
  SHA512:
6
- metadata.gz: 13f95373407fa3c01234cf33d2cab64bc3db04218831bc333db8c108c1eb3dfa2bd27de00cc5b7b81a9f175105e1a8b588b38d10f0afad1081e5d6a2ded709fe
7
- data.tar.gz: e0eccdf6b255ba8127670beee95810044609e931e0167a7a5a257e65fadd44913647751bdb18c7c4132ae3e126f0c30556dc81ca5c9ca3841fb2110492f45206
6
+ metadata.gz: b867a4c3c443e056e6476222862b2431a4c33a1a276f797a44e5c6e787bff8be1f0d6793750108c82d2ab482d17b4ca26f532badd3c7c74a50db8dc51372fb9f
7
+ data.tar.gz: a691215c902cb77fc50fb2e2be32ba347fcbea4f6f72dcb68d7d7f4f530ea0551651e02f0eba604ed433d1d5de1f67e561e2a6b339f91de57b222bf8c50b4e6d
data/README.rdoc CHANGED
@@ -229,6 +229,10 @@ For example:
229
229
 
230
230
  Version 1.1.5:
231
231
 
232
+ * Fix memory leak (#10), many thanks to @paddor
233
+
234
+ Version 1.1.5:
235
+
232
236
  * Fix an error when constructing a GetBulkRequest when using version >= 1.3.1 of the SNMP gem
233
237
 
234
238
  Version 1.1.2:
@@ -33,7 +33,7 @@ module SNMP4EM
33
33
 
34
34
  # Assigns an SNMP ID to an outgoing request so that it can be matched with its incoming response
35
35
  def track_request(request)
36
- @pending_requests.delete(request.snmp_id)
36
+ untrack_request(request.snmp_id)
37
37
 
38
38
  begin
39
39
  @next_index = (@next_index + 1) % MAX_INDEX
@@ -42,6 +42,10 @@ module SNMP4EM
42
42
 
43
43
  @pending_requests[request.snmp_id] = request
44
44
  end
45
+
46
+ def untrack_request(snmp_id)
47
+ @pending_requests.delete(snmp_id)
48
+ end
45
49
  end
46
50
 
47
51
  attr_reader :host, :port, :timeout, :retries, :version, :community_ro, :community_rw
@@ -74,6 +78,9 @@ module SNMP4EM
74
78
 
75
79
  def send_msg(message) # @private
76
80
  self.class.socket.send_datagram message.encode, @host, @port
81
+ rescue EventMachine::ConnectionError
82
+ self.class.untrack_request message.pdu.request_id
83
+ raise
77
84
  end
78
85
 
79
86
  def wrap_in_fiber(request) # @private
@@ -52,12 +52,12 @@ module SNMP4EM
52
52
 
53
53
  def init_callbacks # @private
54
54
  self.callback do
55
- Manager.pending_requests.delete(@snmp_id)
55
+ Manager.untrack_request(@snmp_id)
56
56
  end
57
57
 
58
58
  self.errback do
59
59
  @timeout_timer.cancel
60
- Manager.pending_requests.delete(@snmp_id)
60
+ Manager.untrack_request(@snmp_id)
61
61
  end
62
62
  end
63
63
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snmp4em
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Norman Elton
@@ -121,8 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  - !ruby/object:Gem::Version
122
122
  version: '1.2'
123
123
  requirements: []
124
- rubyforge_project: snmp4em
125
- rubygems_version: 2.6.8
124
+ rubygems_version: 3.0.3
126
125
  signing_key:
127
126
  specification_version: 4
128
127
  summary: A high-performance SNMP engine built on EventMachine and Ruby-SNMP