close() has no affect until next GC #114

chetan opened this Issue May 6, 2012 · 1 comment


None yet

2 participants


I believe this may be covered in the docs for the close method, but they are slightly ambiguous:

* Close the Curl::Easy instance. Any open connections are closed
* The easy handle is reinitialized.  If a previous multi handle was 
* open it is set to nil and will be cleared after a GC.

The last comment about GC appears to only refer to multi handles, but my testing shows that it applies to close() in general. For example:

sleep 20
# connection to server stays open...
# connection is now closed

By contrast, calling Patrion::Session.reset() immediately closes the underlying connection immediately when using that library. I think that is the expected behavior.


yes, that is more of the expected behavior. Connection should be closed immediately as curl_easy_cleanup(rbce->curl); is called on the curl handle.

however, from the comment, the reason it may remain open is because of the multi handle used internally. I'll work on a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment