ghazel-em-apn 0.0.3.3 → 0.0.3.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: 8fba17d49998c5aecbd434d50494704fcc1d86b7
4
- data.tar.gz: b384fa4c6249140b06373ef9be306b3a8a876f36
3
+ metadata.gz: b74f2ce783531402fde06499e6fdf68380f5bc30
4
+ data.tar.gz: d41eb5762ba1e0173f354fa551902d58a86438f2
5
5
  SHA512:
6
- metadata.gz: 486f0691e19a1aeb1ef50d6a8f00e4da5dab2c7b63aaee6d2b93c5bd837e6120964663da20438a595e14ba8a7426a7e3a6ce9ed769953f2229b47b4e194807e5
7
- data.tar.gz: cb440a684c11a42be93870defeb395c119f611e3e1b271ffa43f43db3052fd59ffb583983f5dfb7e00b51683b9f7931325caed7b96dad3f8cbe5d9413b268745
6
+ metadata.gz: 81805e4f9e5d65d094644db1fa40ea2c9ac3d0e464fcb0b8d786dfe1482c4f20c12b0aa12e2d44dbaf6cb83871d6c252663b54e9015366044406d6a65fa7beb9
7
+ data.tar.gz: 285500bacfd35b677f06c40940e0e8d7ca4df577c40ab30e2b5d641fe47e925877d79b54513914037a14ad549aa379ff42bf631c170ade0368fd860597f5ed97
@@ -14,7 +14,7 @@ module EventMachine
14
14
  end
15
15
 
16
16
  def post_init
17
- @buf = ''
17
+ @buf = StringIO.new('', 'a+b')
18
18
  start_tls(
19
19
  :private_key_file => client.key,
20
20
  :cert_chain_file => client.cert,
@@ -27,15 +27,19 @@ module EventMachine
27
27
  end
28
28
 
29
29
  def receive_data(data)
30
- @buf << data
31
- while @buf.size >= 38
32
- attempt = FailedDeliveryAttempt.new(@buf.slice!(0,38))
30
+ @buf.write data
31
+ return if @buf.size < 38
32
+
33
+ @buf.rewind
34
+ while @buf.size - @buf.pos >= 38
35
+ attempt = FailedDeliveryAttempt.new(@buf.read(38))
33
36
  EM::APN.logger.warn(attempt.to_s)
34
37
 
35
38
  if client.feedback_callback
36
39
  client.feedback_callback.call(attempt)
37
40
  end
38
41
  end
42
+ @buf.reopen(@buf.read, 'a+b')
39
43
  end
40
44
 
41
45
  def unbind
@@ -1,5 +1,5 @@
1
1
  module EventMachine
2
2
  module APN
3
- VERSION = "0.0.3.3"
3
+ VERSION = "0.0.3.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghazel-em-apn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.3
4
+ version: 0.0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Yeu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-24 00:00:00.000000000 Z
11
+ date: 2014-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eventmachine