From fa7e387b81a13dceb31e00a4d01680f7a63c28cb Mon Sep 17 00:00:00 2001 From: Varun Chatterji Date: Thu, 20 Aug 2015 01:57:36 +0800 Subject: [PATCH] Without a timeout set, the socket can "hang" waiting for a response. --- lib/Parse.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Parse.js b/lib/Parse.js index f6dea3d..d72bf64 100644 --- a/lib/Parse.js +++ b/lib/Parse.js @@ -445,6 +445,10 @@ function parseRequest(method, path, data, callback, contentType, sessionToken) { callback(err); }); }); + + req.setTimeout(5000, function () { + req.connection.destroy(); + }); body && req.write(body, contentType ? 'binary' : 'utf8'); req.end();