Permalink
Browse files

Merge pull request #17 from bluezi/master

fix #15
  • Loading branch information...
2 parents 3bafe8b + ceee5fe commit 29a1f68ac0aee7973692ef039c1b350282c654eb @tarcieri committed Aug 10, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 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

0 comments on commit 29a1f68

Please sign in to comment.