1
- /*! Socket.IO.js build:0.8.6 , development. Copyright(c) 2011 LearnBoost <dev@learnboost.com> MIT Licensed */
1
+ /*! Socket.IO.js build:0.9.0 , development. Copyright(c) 2011 LearnBoost <dev@learnboost.com> MIT Licensed */
2
2
3
3
/**
4
4
* socket.io
22
22
* @api public
23
23
*/
24
24
25
- io . version = '0.8.6 ' ;
25
+ io . version = '0.9.0 ' ;
26
26
27
27
/**
28
28
* Protocol implemented.
102
102
} ;
103
103
104
104
} ) ( 'object' === typeof module ? module . exports : ( this . io = { } ) , this ) ;
105
-
106
105
/**
107
106
* socket.io
108
107
* Copyright(c) 2011 LearnBoost <dev@learnboost.com>
210
209
for ( ; i < l ; ++ i ) {
211
210
kv = params [ i ] . split ( '=' ) ;
212
211
if ( kv [ 0 ] ) {
213
- query [ kv [ 0 ] ] = decodeURIComponent ( kv [ 1 ] ) ;
212
+ query [ kv [ 0 ] ] = kv [ 1 ] ;
214
213
}
215
214
}
216
215
399
398
*/
400
399
401
400
util . indexOf = function ( arr , o , i ) {
402
- if ( Array . prototype . indexOf ) {
403
- return Array . prototype . indexOf . call ( arr , o , i ) ;
404
- }
405
-
401
+
406
402
for ( var j = arr . length , i = i < 0 ? i + j < 0 ? 0 : i + j : i || 0 ;
407
403
i < j && arr [ i ] !== o ; i ++ ) { }
408
404
1273
1269
// If the connection in currently open (or in a reopening state) reset the close
1274
1270
// timeout since we have just received data. This check is necessary so
1275
1271
// that we don't reset the timeout on an explicitly disconnected connection.
1276
- if ( this . connected || this . connecting || this . reconnecting ) {
1272
+ if ( this . socket . connected || this . socket . connecting || this . socket . reconnecting ) {
1277
1273
this . setCloseTimeout ( ) ;
1278
1274
}
1279
1275
1465
1461
'undefined' != typeof io ? io : module . exports
1466
1462
, 'undefined' != typeof io ? io : module . parent . exports
1467
1463
) ;
1468
-
1469
1464
/**
1470
1465
* socket.io
1471
1466
* Copyright(c) 2011 LearnBoost <dev@learnboost.com>
1616
1611
var xhr = io . util . request ( ) ;
1617
1612
1618
1613
xhr . open ( 'GET' , url , true ) ;
1614
+ xhr . withCredentials = true ;
1619
1615
xhr . onreadystatechange = function ( ) {
1620
1616
if ( xhr . readyState == 4 ) {
1621
1617
xhr . onreadystatechange = empty ;
1869
1865
1870
1866
Socket . prototype . onError = function ( err ) {
1871
1867
if ( err && err . advice ) {
1872
- if ( err . advice === 'reconnect' && this . connected ) {
1868
+ if ( this . options . reconnect && err . advice === 'reconnect' && this . connected ) {
1873
1869
this . disconnect ( ) ;
1874
1870
this . reconnect ( ) ;
1875
1871
}
1928
1924
self . publish ( 'reconnect' , self . transport . name , self . reconnectionAttempts ) ;
1929
1925
}
1930
1926
1927
+ clearTimeout ( self . reconnectionTimer ) ;
1928
+
1931
1929
self . removeListener ( 'connect_failed' , maybeReconnect ) ;
1932
1930
self . removeListener ( 'connect' , maybeReconnect ) ;
1933
1931
@@ -3166,7 +3164,6 @@ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="Sho
3166
3164
, 'undefined' != typeof io ? io : module . parent . exports
3167
3165
, this
3168
3166
) ;
3169
-
3170
3167
/**
3171
3168
* socket.io
3172
3169
* Copyright(c) 2011 LearnBoost <dev@learnboost.com>
@@ -3304,7 +3301,7 @@ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="Sho
3304
3301
*/
3305
3302
3306
3303
HTMLFile . check = function ( ) {
3307
- if ( 'ActiveXObject' in window ) {
3304
+ if ( typeof window != "undefined" &&
9E88
span> 'ActiveXObject' in window ) {
3308
3305
try {
3309
3306
var a = new ActiveXObject ( 'htmlfile' ) ;
3310
3307
return a && io . Transport . XHR . check ( ) ;
@@ -3428,14 +3425,20 @@ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="Sho
3428
3425
3429
3426
function onload ( ) {
3430
3427
this . onload = empty ;
3428
+ this . onerror = empty ;
3431
3429
self . onData ( this . responseText ) ;
3432
3430
self . get ( ) ;
3433
3431
} ;
3434
3432
3433
+ function onerror ( ) {
3434
+ self . onClose ( ) ;
3435
+ } ;
3436
+
3435
3437
this . xhr = this . request ( ) ;
3436
3438
3437
3439
if ( global . XDomainRequest && this . xhr instanceof XDomainRequest ) {
3438
- this . xhr . onload = this . xhr . onerror = onload ;
3440
+ this . xhr . onload = onload ;
3441
+ this . xhr . onerror = onerror ;
3439
3442
} else {
3440
3443
this . xhr . onreadystatechange = stateChange ;
3441
3444
}
@@ -3453,7 +3456,7 @@ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="Sho
3453
3456
io . Transport . XHR . prototype . onClose . call ( this ) ;
3454
3457
3455
3458
if ( this . xhr ) {
3456
- this . xhr . onreadystatechange = this . xhr . onload = empty ;
3459
+ this . xhr . onreadystatechange = this . xhr . onload = this . xhr . onerror = empty ;
3457
3460
try {
3458
3461
this . xhr . abort ( ) ;
3459
3462
} catch ( e ) { }
0 commit comments