From 6731b2d779fcdc19eb3c8b5498224138f207d3ed Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Tue, 31 Aug 2010 19:39:50 -0700 Subject: [PATCH] Added onDisconnect call if long poll is interrupted --- lib/transports/xhr-polling.js | 2 ++ socket.io.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/transports/xhr-polling.js b/lib/transports/xhr-polling.js index 65766b68..81e9602c 100644 --- a/lib/transports/xhr-polling.js +++ b/lib/transports/xhr-polling.js @@ -48,6 +48,8 @@ if (status == 200){ if (self._xhr.responseText.length) self._onData(self._xhr.responseText); self._get(); + } else { + self._onDisconnect(); } } }; diff --git a/socket.io.js b/socket.io.js index 386a6a98..c3fc60d9 100644 --- a/socket.io.js +++ b/socket.io.js @@ -583,6 +583,8 @@ if ('jQuery' in this) jQuery.io = this.io; if (status == 200){ if (self._xhr.responseText.length) self._onData(self._xhr.responseText); self._get(); + } else { + self._onDisconnect(); } } };