Skip to content

Commit

Permalink
Fix for #309 [atmosphere.js] Reconnect function must always be invoke…
Browse files Browse the repository at this point in the history
…d before reconnect
  • Loading branch information
jfarcand committed Apr 27, 2012
1 parent c942c88 commit 20db8b6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js
Original file line number Diff line number Diff line change
Expand Up @@ -969,26 +969,25 @@ jQuery.atmosphere = function() {
}

if (!rq.executeCallbackBeforeReconnect) {
_invokeCallback();
_open('re-opening', rq.transport);
_reconnect(ajaxRequest, rq, false);
}

// For backward compatibility with Atmosphere < 0.8
if (_response.responseBody.indexOf("parent.callback") != -1) {
jQuery.atmosphere.log(rq.logLevel, ["parent.callback no longer supported with 0.8 version and up. Please upgrade"]);
}
_invokeCallback();

if (rq.executeCallbackBeforeReconnect) {
_invokeCallback();
_open('re-opening', rq.transport);
_reconnect(ajaxRequest, rq, false);
}

if ((rq.transport == 'streaming') && (responseText.length > rq.maxStreamingLength)) {
// Close and reopen connection on large data received
ajaxRequest.abort();
_doRequest(ajaxRequest, rq, true);
} else {
_open('re-opening', rq.transport);
}
}
};
Expand Down

0 comments on commit 20db8b6

Please sign in to comment.