apns_simple 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apns_simple/client.rb +7 -1
- data/lib/apns_simple/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eec0b4e04de00e365c95c6c74dc18dbd832dfb16
|
4
|
+
data.tar.gz: 5aaecd12d555f4745abc64d908b29ea6614f31fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d665e823c3d2e01c716274c847411fa671f7024ca84e30a1f35eb9720b0cfa4d04293140f724e96a593b5fc90855521a8e0d73c91d51f88c24e54af1637fc75f
|
7
|
+
data.tar.gz: f4a4ad5eb5a5aab4a6b8d041601295d5cc03ab0bb661a78c8a85c23912666160437341efac0e0c4fa5ef3a2f03bd8f1df1f93fd6fc9172ec4e601e5a023efcac
|
data/lib/apns_simple/client.rb
CHANGED
@@ -22,6 +22,7 @@ module ApnsSimple
|
|
22
22
|
10 => 'Shutdown',
|
23
23
|
255 => 'Unknown error'
|
24
24
|
}
|
25
|
+
TIMEOUT = 5 # In seconds
|
25
26
|
|
26
27
|
def initialize(options)
|
27
28
|
certificate = options.fetch(:certificate)
|
@@ -49,7 +50,12 @@ module ApnsSimple
|
|
49
50
|
ssl.write(notification.payload)
|
50
51
|
ssl.flush
|
51
52
|
|
52
|
-
|
53
|
+
unless IO.select([ssl], nil, nil, TIMEOUT)
|
54
|
+
notification.error = "No response from APNS server received in #{TIMEOUT} seconds. Exit by timeout."
|
55
|
+
return
|
56
|
+
end
|
57
|
+
|
58
|
+
if (error = ssl.read(6))
|
53
59
|
command, status, _index = error.unpack("ccN")
|
54
60
|
notification.error = command == COMMAND ? "#{status}: #{CODES[status]}" : "Unknown command received from APNS server: #{command}"
|
55
61
|
end
|
data/lib/apns_simple/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apns_simple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Voronkov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|