Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

issue 15 - changed HttpClient#on_request_complete and HttpClient#on_c…

…lose
  • Loading branch information...
commit ceee5fe09f65ad417b99ef1f92c84d7880143cf5 1 parent 3bafe8b
Jeremy Gables authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.