Skip to content

Loading…

resolve issue 15 #17

Merged
merged 1 commit into from

2 participants

@bluezi

changed: HttpClient#on_request_complete

added: HttpClient#on_close

@tarcieri tarcieri merged commit 29a1f68 into tarcieri:master
@tarcieri
Owner

Merged! Thanks for contributing. Let me know if you'd like commit access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 8, 2011
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/cool.io/http_client.rb
View
9 lib/cool.io/http_client.rb
@@ -195,7 +195,14 @@ def on_body_data(data)
# Called when the request has completed
def on_request_complete
- close
+ @state == :finished ? close : @state = :finished
+ end
+
+ # called by close
+ def on_close
+ if @state != :finished and @state == :body
+ on_request_complete
+ end
end
# Called when an error occurs dispatching the request
Something went wrong with that request. Please try again.