geemus/excon — pull request #78 by dpiddy (2011-11-01 15:39:47+00:00)
Title: EOFError handling fix

We've been seeing things that talk to AWS sometimes get stuck and consume 100% CPU.

Tracked it down to how `EOFError` is handled. In this particular case there was no way for `Socket#read` to return `nil` after filling the buffer as much as possible and then getting `EOFError`. So [this loop](https://github.com/geemus/excon/blob/f245f613a3bc284dae346d0a8d567c7e523c6a1e/lib/excon/response.rb#L56) never stopped looping.

Not immediately sure how else something like this could be tested without resorting to the "bad" test server I added; let me know if there's a better way. But that server could be expanded to cover other things that are hard to test with the rackups, such as read timeouts.