jeffwilcox/mpns — pull request #21 by tjunnone (2013-06-28 19:23:04+00:00)
Title: Fix the HTTP response stream not being properly discarded

Got bitten by the following bug: After doing a few notification requests, MPNS would hang for a while. MPNS uses the default Node.js HTTP agent connection pool for outgoing requests, which defaults to 5 connections.

The message object received in the 'response' event is a stream, and must be consumed since Node.js version 0.10.x before the connection is released back to the pool. From the docs:
If you add a 'response' event handler, then you must consume the data from the response object, either by calling response.read() whenever there is a 'readable' event, or by adding a 'data' handler, or by calling the .resume() method.

This pull requests simply adds the resume method, which fixes my problem.