Skip to content

Commit

Permalink
fix(bosh): mark first request dead when second is done
Browse files Browse the repository at this point in the history
  • Loading branch information
sunduev authored and jcbrand committed Apr 28, 2022
1 parent 1877ecb commit fb79830
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/bosh.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,9 @@ Strophe.Bosh = class Bosh {
return;
}

const reqIs0 = (this._requests[0] === req);
const reqIs1 = (this._requests[1] === req);

const valid_request = reqStatus > 0 && reqStatus < 500;
const too_many_retries = req.sends > this._conn.maxRetries;
if (valid_request || too_many_retries) {
Expand All @@ -629,8 +632,6 @@ Strophe.Bosh = class Bosh {

if (reqStatus === 200) {
// request succeeded
const reqIs0 = (this._requests[0] === req);
const reqIs1 = (this._requests[1] === req);
// if request 1 finished, or request 0 finished and request
// 1 is over Strophe.SECONDARY_TIMEOUT seconds old, we need to
// restart the other - both will be in the first spot, as the
Expand Down

0 comments on commit fb79830

Please sign in to comment.