Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

spdy

Package Overview
Dependencies
Maintainers
3
Versions
206
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spdy - npm Package Compare versions

Comparing version 3.4.3 to 3.4.4

28

lib/spdy/handle.js

@@ -54,7 +54,27 @@ 'use strict';

var state = this._spdyState;
var stream = state.stream;
if (state.ending)
state.stream.end(callback);
else
state.stream.abort(callback);
if (state.ending) {
// The .end() method of the stream may be called by us or by the
// .shutdown() method in our super-class. If the latter has already been
// called, then calling the .end() method below will have no effect, with
// the result that the callback will never get executed, leading to an ever
// so subtle memory leak.
if (stream._writableState.finished) {
// NOTE: it is important to call `setImmediate` instead of `nextTick`,
// since this is how regular `handle.close()` works in node.js core.
//
// Using `nextTick` will lead to `net.Socket` emitting `close` before
// `end` on UV_EOF. This results in aborted request without `end` event.
setImmediate(callback);
} else if (stream._writableState.ending) {
stream.once('finish', function() {
callback(null);
});
} else {
stream.end(callback);
}
} else {
stream.abort(callback);
}

@@ -61,0 +81,0 @@ // Only a single end is allowed

2

package.json
{
"name": "spdy",
"version": "3.4.3",
"version": "3.4.4",
"description": "Implementation of the SPDY protocol on node.js.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -391,2 +391,22 @@ var assert = require('assert');

});
it('should destroy request after end', function(done) {
var stream = client.request({
method: 'POST',
path: '/post'
}, function(err) {
assert(!err);
});
stream.end();
stream.on('error', function() {});
server.on('request', function(req, res) {
res.end();
res.destroy();
res.socket.on('close', function() {
done();
});
});
});
});

@@ -393,0 +413,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc