diff --git a/modules/javascript/src/main/webapp/javascript/atmosphere.js b/modules/javascript/src/main/webapp/javascript/atmosphere.js index f1017056..c4c54401 100644 --- a/modules/javascript/src/main/webapp/javascript/atmosphere.js +++ b/modules/javascript/src/main/webapp/javascript/atmosphere.js @@ -1529,7 +1529,7 @@ if (_abortingConnection) { atmosphere.util.log(_request.logLevel, ["Websocket closed normally"]); - } else if (!webSocketOpened) { + } else if (!webSocketOpened && _response.transport === 'websocket' && _request.fallbackTransport !== 'websocket') { _reconnectWithFallbackTransport("Websocket failed on first connection attempt. Downgrading to " + _request.fallbackTransport + " and resending"); } else if (_request.reconnect && _response.transport === 'websocket' ) { @@ -1730,11 +1730,12 @@ atmosphere.util.onTransportFailure(errorMessage, _request); } - _request.transport = _request.fallbackTransport; var reconnectInterval = _request.connectTimeout === -1 ? 0 : _request.connectTimeout; if (_request.reconnect && _request.transport !== 'none' || _request.transport == null) { + _request.transport = _request.fallbackTransport; _request.method = _request.fallbackMethod; _response.transport = _request.fallbackTransport; + _response.state = ''; _request.fallbackTransport = 'none'; if (reconnectInterval > 0) { _request.reconnectId = setTimeout(function () {