Skip to content

Commit

Permalink
lib: fix connection restore
Browse files Browse the repository at this point in the history
PR-URL: #289
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Mykola Bilochub <nbelochub@gmail.com>
  • Loading branch information
nechaido authored and belochub committed Jan 22, 2018
1 parent 531817e commit 78d764f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ class Session extends Map {
}

_restore(newConnection, receivedCount) {
this.connection.close();
if (this.connection) {
this.connection.close();
}
this.connection = newConnection;
for (let i = this.guaranteedDeliveredCount + 1; i <= receivedCount; i++) {
this.buffer.delete(i);
Expand Down

0 comments on commit 78d764f

Please sign in to comment.