Comparing version 0.0.2 to 0.0.3
@@ -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() { |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
23456
574
0
2