voloko / twitter-stream

Twitter realtime API client
MIT License
233 stars 81 forks source link

Application Failure retries never incremented #1

Closed obin-zz closed 14 years ago

obin-zz commented 14 years ago

When Twitter returns an error status (e.g., HTTP/1.1 500), it throws an error. However, when it reaches the end of the HTTP headers in parse_header_line, reset_timeouts resets the app's status, so if there's a similar error on the next reconnect, there's no record of consecutive failures and the timeout between retries never increases.

To address this issue, I changed line 178 from

reset_timeouts

to

reset_timeouts if @code == 200

Thus, it only resets the state when there's a successful connection.

(Sorry I don't know Ruby and Git well enough to implement this patch and test it myself.)

voloko commented 14 years ago

Thanks. Updated the gem and code.