[Pkg-javascript-commits] [node-stream-http] 55/208: Stop emitting 'close'

Bastien Roucariès rouca at moszumanska.debian.org
Sun Aug 13 13:39:28 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-stream-http.

commit 73f1e6f3f0af1cef9e2a8eb952ed010f1e41673a
Author: John Hiesey <john at hiesey.com>
Date:   Sun Jul 12 21:08:00 2015 -0700

    Stop emitting 'close'
    
    1. This fixes an issue where the `response` module emits an extra
      'end'
    2. Node doesn't seem to emit 'close', even if "Connection: close"
      is specified
    3. There isn't a real socket, and this module already doesn't
      emit the other socket-related events (and this is documented)
---
 lib/response.js | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/response.js b/lib/response.js
index ac2153f..2be9105 100644
--- a/lib/response.js
+++ b/lib/response.js
@@ -39,7 +39,6 @@ var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode) {
 			reader.read().then(function (result) {
 				if (result.done) {
 					self.push(null)
-					self.emit('close')
 					return
 				}
 				self.push(new Buffer(result.value))
@@ -151,7 +150,6 @@ IncomingMessage.prototype._onXHRProgress = function () {
 			}
 			reader.onload = function () {
 				self.push(null)
-				self.emit('close')
 			}
 			// reader.onerror = ??? // TODO: this
 			reader.readAsArrayBuffer(response)
@@ -161,6 +159,5 @@ IncomingMessage.prototype._onXHRProgress = function () {
 	// The ms-stream case handles end separately in reader.onload()
 	if (self._xhr.readyState === rStates.DONE && self._mode !== 'ms-stream') {
 		self.push(null)
-		self.emit('close')
 	}
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-stream-http.git



More information about the Pkg-javascript-commits mailing list