Граф коммитов

250 Коммитов

Автор SHA1 Сообщение Дата
Andrew Naylor 4911bb724c Added some more error handling
Also fixes a bug with the error handling at the bottom of sendNotification.
2012-07-05 21:38:28 +01:00
Andrew Naylor 9595f9626c Fixes #47 2012-06-29 08:31:05 +01:00
Andrew Naylor d00aba0156 v1.2.1 2012-06-28 23:21:57 +01:00
Andrew Naylor a5c5e30197 Use console.log instead of .error when 'debug' module cannot be loaded. 2012-06-28 23:20:29 +01:00
Andrew Naylor 34bc1d280b More logging 2012-06-28 23:19:26 +01:00
Andrew Naylor 6c57a52887 Fixes #46 2012-06-28 23:18:32 +01:00
Andrew Naylor 69dbf09396 Fix for notification queue stalling.
The 'ondrain' event for a socket isn't called if the entire buffer was flushed during the .write() call. Therefore the queue will stall in these cases. Instead we immediately call the .socketDrained() method to continue queue processing.
2012-06-23 00:22:05 +01:00
Andrew Naylor e3c768b65f Another small change in the reconnection logic. 2012-06-22 23:41:04 +01:00
Andrew Naylor a9a14af82b Added some debug statements and changed some connection lost handling. 2012-06-22 23:22:26 +01:00
Andrew Naylor 18a5259a7c Readme.md 2012-06-16 16:46:03 +01:00
Andrew Naylor a82ed34347 Another Readme.md correction 2012-06-16 16:44:49 +01:00
Andrew Naylor 43fc54c267 Updated Readme.md 2012-06-16 16:41:36 +01:00
Andrew Naylor 5530d7d310 Lots of Doc. Some Notification helper methods. 2012-06-16 13:13:35 +01:00
Andrew Naylor 8490ab09e0 Rewritten feedback
Tidied up code formatting
Reset notification ID when it gets too big
Use readUIntXXBE etc. methods instead of int2bytes and bytes2int
Improved control flow for errors
2012-06-15 00:39:06 +01:00
Andrew Naylor 30216fde36 Fixed an exports problem. 2012-06-14 01:05:51 +01:00
Andrew Naylor 519c011beb Refactored connection handling.
Now making extensive use of promises. Including the possibility of handling notification errors with a promise also.
2012-06-14 00:59:54 +01:00
Andrew Naylor 0c01598a67 Version 1.1.7
Fixes a problem with sockets being closed on transmission error, causing EPIPE errors
Issues #29, #30
2012-05-09 22:32:45 +01:00
Andrew Naylor 4e81dd6324 Addresses issue #30
This should prevent crashing with EPIPE error on connection error.
2012-05-09 22:20:40 +01:00
Andrew Naylor 03dd81ecb0 Merge pull request #26 from jacksonh/master
Add a passphrase option for key files.
2012-03-07 14:59:56 -08:00
Jackson Harper 5beae1726d Add a passphrase option that can automatically set the passphrase on the ssl key 2012-03-07 16:27:48 -05:00
Andrew Naylor 9be4c80d8d Version 1.1.6 2012-01-21 17:15:04 +00:00
Andrew Naylor d6ca87f8f3 Merge pull request #22 from pereckerdal/master
Fixes bug introduced by a3cf8b090b where the socket buffer length wasn't checked correctly.
2012-01-19 14:15:44 -08:00
Per Eckerdal 53d04bae92 Fixes bug introduced by a3cf8b090b 2012-01-17 20:17:19 +01:00
Andrew Naylor f97d29db50 Version 1.1.5
* Feature: Certificate and Key data can be passed directly when creating a new connection instead of providing a file name on disk. (See: `certData` and `keyData` options)
* Deliver whole write buffer if the socket is ready.
* Fixed some global memory leaks.
* Tidied up some code formatting glitches flagged by jslint
* Fixes #16, #17, #18, #19, #20
2012-01-06 18:19:12 +00:00
Andrew Naylor 3be6182a2d Fixed #17, #20
Removed a global callback, raised by mypark#17
2012-01-06 18:09:27 +00:00
keithnlarsen a847befdff Make the apn library take a cert and a key as a string instead of as a file so i can store multiples of them. Also fixed up a bunch of js lint error, not all of them, but most of them. 2011-12-31 18:08:40 +00:00
Andrew Naylor a3cf8b090b Fixes #16
Fix by @bobrik
2011-12-03 21:15:35 +00:00
Andrew Naylor 118c85e62f Fixes #17 2011-12-03 21:13:24 +00:00
Andrew Naylor 74ed13fe77 v1.1.4
Updated the readme and package.json for release
2011-11-25 00:21:54 +00:00
Andrew Naylor 4b03af31f3 Fixes #15: Sending unified emoji via apn
Added encoding parameter when sending notification
2011-11-25 00:21:05 +00:00
Andrew Naylor a55ed78c79 Readme for v1.1.3 2011-11-25 00:07:06 +00:00
Andrew Naylor 66a0a01cec Version 1.1.3
Fixes #11,#12,#13,#14

Ensure delivery of notifications to Apple even under heavy load.
2011-11-24 23:42:28 +00:00
Andrew Naylor b213da698a Reinstated the check for whether we are using the enhanced binary interface or not.
If we aren't then we can't find which notification made things go wrong then none of the rest of the method is relevant and we can just go back to draining the writeBuffer.
2011-10-18 19:01:55 +01:00
Andrew Naylor c9fddc622a Removed logging used for debugging. 2011-10-18 18:57:03 +01:00
Andrew Naylor 463d22c906 Rewritten to better incorporate the idea of ensured-delivery.
Basically I've fixed architectural failings of the first release. This should be far more stable than it has been previously with hopefully not too much increased overhead.
2011-10-18 18:51:56 +01:00
Ian Babrou 38c885c1cf reorganized handleTransmissionError, removed resending cachedNotes 2011-09-27 20:41:24 +04:00
Ian Babrou 2097d6f131 rewritten with drain event, should be ok now 2011-09-26 10:16:44 +04:00
Ian Babrou 47519f5f5c Added ability to ensure that every push is delivered to Apple
If you send many push notifications (10k) and 10th will have invalid token,
there is chance that 2k push notifications will be broken before broken pipe exception.
This commit adds checking for every push message and fix bug with close event listener.
2011-09-25 18:07:56 +04:00
Andrew Naylor 516aba71dd Version 1.1.2 2011-08-31 23:31:02 +01:00
Andrew Naylor 052eabf691 Fixes #9, Addresses an issue if the socket disconnects with queued notifications it would be reinitialised before its teardown is completed leaving the system in an undefined state. 2011-08-31 23:27:30 +01:00
Andrew Naylor 623a5f967e Version 1.1.1
Closes #6
2011-04-20 22:52:10 +01:00
Andrew Naylor ee3910eeeb Fixes #6 where error (i.e. losing net connection) would bring down the whole node instance.
Ideally this would give the user the option to specify an error handler in case the error is more sinister. If there is any demand for this open an issue or send a pull request.
2011-04-20 22:42:56 +01:00
Andrew Naylor 0a253230b2 Version 1.1.0 2011-03-12 23:58:52 +00:00
Andrew Naylor 2968dbbd20 Fixed a token parsing bug
Fencepost error with calculating the correct buffer length to store the token. This should fix an out-of-bounds error I got once with a token of incorrect length.
2011-03-07 19:04:23 +00:00
Andrew Naylor 8056c349aa Updated package.json to match API usage changes. 2011-03-06 01:01:15 +00:00
Andrew Naylor db064b17c3 Initial reworking of network code to utilise new TLS API in node 0.4+.
I'm not entirely sure I have the error checking right/sufficient.

The method of queueing pending messages whilst connecting has been changed to an array which the data is pushed/shifted from as it is no longer possible to add a listener to trigger the write because the socket will change as it is recreated.
2011-03-06 00:45:27 +00:00
Andrew Naylor 6779c0fda3 Version 1.0.3, fixed a typo in the docs
* Issue #3 fixed.
2011-03-01 19:28:29 +00:00
Andrew Naylor 1cc2b8f0b6 Fixed a documentation bug where:
var apnsConnection = apns.connection(options);

should have read:

var apnsConnection = new apns.connection(options);

Issue #3
2010-12-28 21:13:33 +00:00
Andrew Naylor 6c7fd0f2fa Version 1.0.2, fixed a critical issue with error callback not firing.
Issue #1 fixed where error callback was incorrectly referenced.
2010-12-22 22:50:36 +00:00
Andrew Naylor b83f9e7c91 Fixed issue #1.
errorCallback should in fact be options.errorCallback on lines 159-160
2010-11-18 21:35:38 +00:00