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

limits

Package Overview
Dependencies
Maintainers
4
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

limits - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

19

lib/index.js

@@ -6,6 +6,3 @@ /*

*/
var url = require('url'),
fs = require('fs'),
net = require('net'),
timers = require('timers'),
var timers = require('timers'),
http = require('http');

@@ -172,2 +169,13 @@

/*
* Set Socket NoDelay to true
*/
function setNoDelay(conf, req) {
var socket;
if (conf.socket_no_delay) {
socket = req.connection && req.connection.socket ? req.connection.socket : req.socket;
socket.setNoDelay(true);
}
}
/*
* Sets the maxSockects

@@ -194,3 +202,3 @@ */

return;
}
}

@@ -214,2 +222,3 @@ if (typeof conf.post_max_size === "string") {

instrumentReq(conf, req, resp);
setNoDelay(conf, req);

@@ -216,0 +225,0 @@ req.on('data', function (data) {

@@ -5,3 +5,3 @@ {

"author": "Abhinav Raj <abhinavr@yahoo-inc.com>",
"version": "0.0.2",
"version": "0.0.3",
"devDependencies": {

@@ -8,0 +8,0 @@ "ytestrunner": "*",

@@ -32,3 +32,3 @@ limits

* Setting the http.Agent.defaultMaxSockets for the entire app
* Setting the socket noDelay
In config, use: { socket_no_delay: [boolean] }, if false - nothing will be set.

@@ -35,0 +35,0 @@

@@ -319,3 +319,4 @@ var http = require('http'),

"enable" : "true",
"idle_timeout" : 0 // will be overwritten by local config
"idle_timeout" : 0, // will be overwritten by local config
"socket_no_delay" : true
});

@@ -325,3 +326,4 @@

resp = getResp(),
next = false;
next = false,
noDelay = false;

@@ -337,2 +339,5 @@ req.mod_config = {

socketCalled = true;
},
setNoDelay : function() {
noDelay = true;
}

@@ -347,3 +352,5 @@ }

Assert.isTrue(socketCalled);
Assert.isTrue(noDelay);
noDelay = false;

@@ -356,2 +363,5 @@ socketCalled = false;

},
setNoDelay : function() {
noDelay = true;
},
pause : function() {

@@ -361,2 +371,3 @@ }

};
delete req.socket;

@@ -368,2 +379,3 @@

Assert.isTrue(socketCalled);
Assert.isTrue(noDelay);
},

@@ -370,0 +382,0 @@ 'Verify that limit works with correct url length' : function() {

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