Changeset 543
- Timestamp:
- 09/10/08 00:39:45 (4 months ago)
- Files:
-
- 1 modified
-
branches/0.7/daemon/orbited/static/Orbited.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.7/daemon/orbited/static/Orbited.js
r542 r543 1 1 2 // NOTE: to log/debug with Orbited, there are two methods: 2 3 // Use firebug … … 592 593 ;;; self.logger.debug('transportOnClose'); 593 594 if (self.readyState < self.READY_STATE_CLOSED) { 594 doClose(Orbited.Statuses.ServerClosedConnection) 595 try { 596 doClose(Orbited.Statuses.ServerClosedConnection) 597 } 598 catch(e) { 599 // Fix for navigation-close 600 return 601 } 595 602 } 596 603 } … … 1162 1169 // If we got a 200, then we're in business 1163 1170 if (status == 200) { 1164 heartbeatTimer = window.setTimeout(heartbeatTimeout, Orbited.settings.HEARTBEAT_TIMEOUT); 1171 try { 1172 heartbeatTimer = window.setTimeout(heartbeatTimeout, Orbited.settings.HEARTBEAT_TIMEOUT); 1173 } 1174 catch(e) { 1175 // Happens after navigation 1176 self.close() 1177 return 1178 } 1165 1179 var testtimer = heartbeatTimer; 1166 1180 } … … 1244 1258 // self.logger.debug('do abort..') 1245 1259 xhr.abort(); 1246 window.clearTimeout(heartbeatTimer); 1260 window.clearTimeout(heartbeatTimer); 1247 1261 } 1248 1262 else { … … 1307 1321 window.clearTimeout(heartbeatTimer); 1308 1322 ;;; self.logger.debug('clearing heartbeatTimer', heartbeatTimer) 1309 heartbeatTimer = window.setTimeout(function() { 1323 try { 1324 heartbeatTimer = window.setTimeout(function() { 1310 1325 ;;; self.logger.debug('timer', testtimer, 'did it'); 1311 heartbeatTimeout(); 1312 }, Orbited.settings.HEARTBEAT_TIMEOUT); 1326 heartbeatTimeout(); 1327 }, Orbited.settings.HEARTBEAT_TIMEOUT); 1328 } 1329 catch(e) { 1330 1331 return 1332 } 1313 1333 var testtimer = heartbeatTimer; 1314 1334