bcoe/thumbd — pull request #16 by taeram (2013-10-08 16:34:13+00:00)
Title: Switch to AWS Node.js SDK

This PR changes our AWS library from [aws-lib](https://github.com/livelycode/aws-lib) to Amazon's [aws-sdk-js](https://github.com/aws/aws-sdk-js).

The reason for the switch is to fix an issue I've been having recently, where thumbd ha-s been throwing several of these errors per second:
```
2013-10-08T15:07:18.623362+00:00 wait for message on 1234567890/foo-bar-baz
2013-10-08T15:07:18.670014+00:00 { [Error: Parse Error] bytesParsed: 0, code: 'HPE_INVALID_CONSTANT' }
```

Apparently, the `HPE_INVALID_CONSTANT` error is being thrown because `the remote server responds with
a Content-Length header, but proceeds to send you content longer than that`. See [this post](http://grokbase.com/t/gg/nodejs/136mx1hjz7/fun-little-http-bug) for more details. This points to an issue on AWS' side of things, making it difficult to fix in thumbd or aws-lib. Therefore, I figured switching to the AWS SDK would likely be the easiest solution.

Another benefit of switching to aws-sdk-js is that it's appears updated more often than the aws-lib package. The downside is that aws-sdk-js requires one more configuration setting (AWS region), and a slightly more complex implementation.