Skip to content
Browse files

Merge pull request #470 from dymsza/master

Make the xhr-polling more stable
  • Loading branch information...
2 parents 4e78ece + ec8402c commit 8e407f03237e6554e869bfe5d81752889c185b9d @rauchg rauchg committed Sep 14, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/transports/xhr-polling.js
View
8 lib/transports/xhr-polling.js
@@ -99,12 +99,18 @@
function onload () {
this.onload = empty;
this.onerror = empty;
+ self.retryCounter = 1;
self.onData(this.responseText);
self.get();
};
function onerror () {
- self.onClose();
+ self.retryCounter ++;
+ if(!self.retryCounter || self.retryCounter > 3) {
+ self.onClose();
+ } else {
+ self.get();
+ }
};
this.xhr = this.request();

0 comments on commit 8e407f0

Please sign in to comment.
Something went wrong with that request. Please try again.