diff --git a/modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js b/modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js index 80878a98db8..11da5383f75 100644 --- a/modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js +++ b/modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js @@ -1468,13 +1468,15 @@ jQuery.atmosphere = function() { } if (update) { - // MSIE status can be higher than 1000, Chrome can be 0 + // MSIE 9 and lower status can be higher than 1000, Chrome can be 0 if (ajaxRequest.status >= 300 || ajaxRequest.status == 0) { + + var status = ajaxRequest.status > 1000 ? ajaxRequest.status = 0 : ajaxRequest.status; // Allow recovering from cached content. - if (ajaxRequest.status < 400 && _requestCount++ < _request.maxReconnectOnClose) { + if (status < 400 && _requestCount++ < _request.maxReconnectOnClose) { _reconnect(ajaxRequest, rq, false); } else { - _onError(ajaxRequest.status, "maxReconnectOnClose reached"); + _onError(status, "maxReconnectOnClose reached"); } return; } @@ -1684,7 +1686,9 @@ jQuery.atmosphere = function() { function _reconnect(ajaxRequest, request, force) { if (request.reconnect && force || (request.suspend && request.transport != 'streaming' && _subscribed)) { if (request.reconnect) { - _response.status = ajaxRequest.status; + var status = ajaxRequest.status > 1000 ? ajaxRequest.status = 0 : ajaxRequest.status; + _response.status = status == 0 ? 204 : status; + _response.reason = status == 0 ? "Server resumed the connection or down." : "OK"; _open('re-opening', request.transport, request); request.id = setTimeout(function() { _executeRequest(); diff --git a/samples/chat/src/main/webapp/jquery/application.js b/samples/chat/src/main/webapp/jquery/application.js index 79d4da50712..211fed9996a 100755 --- a/samples/chat/src/main/webapp/jquery/application.js +++ b/samples/chat/src/main/webapp/jquery/application.js @@ -10,7 +10,7 @@ $(function () { var logged = false; var socket = $.atmosphere; var subSocket; - var transport = 'websocket'; + var transport = 'long-polling'; // We are now ready to cut the request var request = { url: document.location.toString() + 'chat',