mikeal/request — pull request #984 by FredKSchott (2014-07-30 01:38:55+00:00)
Title: Cleanup response.body buffer creation to use Buffer.concat()

I just noticed that there was an unnecessary loop over the array of response body buffers, where `Buffer.concat()` would work just as well and take care of the complexity for you.

I also took the chance to clean up some confusing/vague variables:
- `buffer` was actually an array of Buffers, each one being a chunk of the final response body buffer
- now `bodyDataChunks`
- `bodyLen` could have meant length of the array
- now `bodyTotalSize`
- `body` could still be modified before becoming the final `response.body`
- now `bodyData`

All tests are passing, and the update was working fine when I tested it inside my own application.

===

Note: Buffer.concat() was introduced and has remained unchanged since v0.8.0, so request's version compatibility will remain unchanged.