From 7bb123790cb24c3f4491826a9e333532bfd5192d Mon Sep 17 00:00:00 2001 From: Elexy Date: Wed, 4 Apr 2018 13:05:48 +0200 Subject: [PATCH 1/5] end on end --- lib/connection.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/connection.js b/lib/connection.js index 7b7a8abf0..ebcb0a9a2 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -309,7 +309,8 @@ Connection.prototype.end = function () { // 0x58 = 'X' this.writer.add(emptyBuffer) this._ending = true - return this.stream.write(END_BUFFER) + this.stream.write(END_BUFFER) + return this.stream.end() } Connection.prototype.close = function (msg, more) { From fd5dad9816e455530b44dba1385af1883ac3bf67 Mon Sep 17 00:00:00 2001 From: Elexy Date: Wed, 4 Apr 2018 15:44:00 +0200 Subject: [PATCH 2/5] revert change --- lib/connection.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/connection.js b/lib/connection.js index a9f8b8cb7..8744bbe32 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -309,8 +309,7 @@ Connection.prototype.end = function () { // 0x58 = 'X' this.writer.add(emptyBuffer) this._ending = true - this.stream.write(END_BUFFER) - return this.stream.end() + return this.stream.write(END_BUFFER) } Connection.prototype.close = function (msg, more) { From 866f784ee7e044a2026f159e1f5f6961744a7379 Mon Sep 17 00:00:00 2001 From: Elexy Date: Wed, 4 Apr 2018 16:12:01 +0200 Subject: [PATCH 3/5] add .end() --- lib/connection.js | 3 ++- test/unit/test-helper.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/connection.js b/lib/connection.js index 8744bbe32..a9f8b8cb7 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -309,7 +309,8 @@ Connection.prototype.end = function () { // 0x58 = 'X' this.writer.add(emptyBuffer) this._ending = true - return this.stream.write(END_BUFFER) + this.stream.write(END_BUFFER) + return this.stream.end() } Connection.prototype.close = function (msg, more) { diff --git a/test/unit/test-helper.js b/test/unit/test-helper.js index 6cd2d24e0..e9f9e6279 100644 --- a/test/unit/test-helper.js +++ b/test/unit/test-helper.js @@ -17,6 +17,8 @@ p.write = function (packet) { this.packets.push(packet) } +p.end = function () {} + p.setKeepAlive = function () {} p.writable = true From 9e1b0ec8ca6ffd3c4a24ed808a0847d949d12423 Mon Sep 17 00:00:00 2001 From: Elexy Date: Wed, 4 Apr 2018 16:13:45 +0200 Subject: [PATCH 4/5] Revert "add .end()" This reverts commit 866f784ee7e044a2026f159e1f5f6961744a7379. --- lib/connection.js | 3 +-- test/unit/test-helper.js | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/connection.js b/lib/connection.js index a9f8b8cb7..8744bbe32 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -309,8 +309,7 @@ Connection.prototype.end = function () { // 0x58 = 'X' this.writer.add(emptyBuffer) this._ending = true - this.stream.write(END_BUFFER) - return this.stream.end() + return this.stream.write(END_BUFFER) } Connection.prototype.close = function (msg, more) { diff --git a/test/unit/test-helper.js b/test/unit/test-helper.js index e9f9e6279..6cd2d24e0 100644 --- a/test/unit/test-helper.js +++ b/test/unit/test-helper.js @@ -17,8 +17,6 @@ p.write = function (packet) { this.packets.push(packet) } -p.end = function () {} - p.setKeepAlive = function () {} p.writable = true From 90efa6f9228b0ec18e7bc47f78805bc8e4c75eb2 Mon Sep 17 00:00:00 2001 From: Elexy Date: Wed, 4 Apr 2018 16:18:53 +0200 Subject: [PATCH 5/5] end the stream --- lib/connection.js | 4 +++- test/unit/test-helper.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/connection.js b/lib/connection.js index 8744bbe32..b972f61b4 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -309,7 +309,9 @@ Connection.prototype.end = function () { // 0x58 = 'X' this.writer.add(emptyBuffer) this._ending = true - return this.stream.write(END_BUFFER) + + this.stream.write(END_BUFFER) + return this.stream.end() } Connection.prototype.close = function (msg, more) { diff --git a/test/unit/test-helper.js b/test/unit/test-helper.js index 6cd2d24e0..e9f9e6279 100644 --- a/test/unit/test-helper.js +++ b/test/unit/test-helper.js @@ -17,6 +17,8 @@ p.write = function (packet) { this.packets.push(packet) } +p.end = function () {} + p.setKeepAlive = function () {} p.writable = true