diff --git a/lib/http2.js b/lib/http2.js index cdbbbf6975..ab2255bae5 100644 --- a/lib/http2.js +++ b/lib/http2.js @@ -370,7 +370,7 @@ function newParser (type) { }; parser.onMessageComplete = function () { - parser.incoming.emit("eof"); + parser.incoming.emit("end"); }; } return parser; @@ -392,7 +392,7 @@ function connectionListener (socket) { }); // is this really needed? - socket.addListener('eof', function () { + socket.addListener('end', function () { parser.finish(); // unref the parser for easy gc freeParser(parser); diff --git a/lib/net.js b/lib/net.js index 59ee2d0421..232cf906bc 100644 --- a/lib/net.js +++ b/lib/net.js @@ -113,7 +113,7 @@ function Socket (peerInfo) { if (!recvMsg.fd && bytesRead == 0) { self.readable = false; self._readWatcher.stop(); - self.emit('eof'); + self.emit('end'); if (!self.writable) self.forceClose(); } else if (bytesRead > 0) { var start = recvBuffer.used; @@ -266,10 +266,10 @@ Socket.prototype.send = function (data, encoding) { } else { // data is a process.Buffer // walk through the sendQueue, find the first empty buffer - var inserted = false; + //var inserted = false; data.sent = 0; data.used = data.length; - if (!inserted) self.sendQueue.push(data); + self.sendQueue.push(data); self.sendQueueSize += data.used; } return this.flush(); diff --git a/test/mjsunit/test-net-pingpong.js b/test/mjsunit/test-net-pingpong.js index 7569991921..7017e414a6 100644 --- a/test/mjsunit/test-net-pingpong.js +++ b/test/mjsunit/test-net-pingpong.js @@ -29,7 +29,7 @@ function pingPongTest (port, host) { } }); - socket.addListener("eof", function () { + socket.addListener("end", function () { assert.equal(true, socket.writable); assert.equal(false, socket.readable); socket.close();