Skip to content

Commit 23f8a73

Browse files
committed
fix(ConnectionManager): pass connectCount through connectImpl
1 parent 3915bcd commit 23f8a73

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/common/lib/transport/connectionmanager.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,19 +1529,19 @@ class ConnectionManager extends EventEmitter {
15291529
} else if (state == this.states.connected.state) {
15301530
this.upgradeIfNeeded(transportParams);
15311531
} else if (this.transports.length > 1 && this.getTransportPreference()) {
1532-
this.connectPreference(transportParams);
1532+
this.connectPreference(transportParams, connectCount);
15331533
} else {
15341534
this.connectBase(transportParams, connectCount);
15351535
}
15361536
}
15371537

1538-
connectPreference(transportParams: TransportParams): void {
1538+
connectPreference(transportParams: TransportParams, connectCount?: number): void {
15391539
const preference = this.getTransportPreference();
15401540
let preferenceTimeoutExpired = false;
15411541

15421542
if (!Utils.arrIn(this.transports, preference)) {
15431543
this.unpersistTransportPreference();
1544-
this.connectImpl(transportParams);
1544+
this.connectImpl(transportParams, connectCount);
15451545
}
15461546

15471547
Logger.logAction(
@@ -1564,7 +1564,7 @@ class ConnectionManager extends EventEmitter {
15641564
/* Be quite agressive about clearing the stored preference if ever it doesn't work */
15651565
this.unpersistTransportPreference();
15661566
}
1567-
this.connectImpl(transportParams);
1567+
this.connectImpl(transportParams, connectCount);
15681568
}, this.options.timeouts.preferenceConnectTimeout);
15691569

15701570
/* For connectPreference, just use the main host. If host fallback is needed, do it in connectBase.
@@ -1582,7 +1582,7 @@ class ConnectionManager extends EventEmitter {
15821582
} else if (!transport && !fatal) {
15831583
/* Preference failed in a transport-specific way. Try more */
15841584
this.unpersistTransportPreference();
1585-
this.connectImpl(transportParams);
1585+
this.connectImpl(transportParams, connectCount);
15861586
}
15871587
/* If suceeded, or failed fatally, nothing to do */
15881588
});

0 commit comments

Comments
 (0)