mikeal/request — pull request #273 by mafintosh (2012-06-25 15:42:53+00:00)
Title: Pipe back pressure issue

Currently request doesn't return a boolean from write to indicate whether or not the write was flushed nor does it emit a drain event.

This can result in a large memory overhead when piping large files to request because of back pressure.
Consider:

``` js
fs.createReadStream('i_am_large.file').pipe(request.put('http://...');
```

If the above readstream reads faster than request can write we'll end up having most of the file in memory.
This patch fixes this issue by adding the `drain` event and returning the boolean from `req.write`.