From 2b8adb3a83e449704db6da0d69bb345ac006ce06 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 11 Apr 2013 15:45:50 -0700 Subject: [PATCH] Don't hang on `/status/` for newer Node Summary: At some point, Node started requiring us to read data before we can get the 'end' event, it seems. Fixes T2953. Test Plan: Ran server in `--foreground` mode on node v0.11.0, made request to `/status/`, got response. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2953 Differential Revision: https://secure.phabricator.com/D5666 --- support/aphlict/server/aphlict_server.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/support/aphlict/server/aphlict_server.js b/support/aphlict/server/aphlict_server.js index 46bbacdd98..8ac4f137e9 100755 --- a/support/aphlict/server/aphlict_server.js +++ b/support/aphlict/server/aphlict_server.js @@ -182,6 +182,11 @@ var receive_server = http.createServer(function(request, response) { response.end(); }); } else if (request.url == '/status/') { + request.on('data', function(data) { + // We just ignore the request data, but newer versions of Node don't + // get to 'end' if we don't process the data. See T2953. + }); + request.on('end', function() { var status = { 'uptime': (new Date().getTime() - start_time),