cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Issue with Curb and closing connection

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 2 Sep 2009 19:51:53 +0200 (CEST)

On Wed, 2 Sep 2009, Emmanuel Pinault wrote:

> (1..100).each do |n|
> curl = Curl::Easy.new("http://localhost:5000")
> curl.headers["Connection"] = "Close"
> curl.http_post("/test", "q=hello")
> curl = nil
> end
> sleep 60
>
> I really like libcurl but the fact that it is not closing the connection
> after an object is marked to nil.. then it causes all those connection to be
> open until the ruby process finished...

Someone who knows what this binding does under the hood would need to explain
what this snippet actually does in libcurl lingo.

Given your description I would guess that curl_easy_cleanup() is never called
on the easy handle so the connection is kept alive.

-- 
  / daniel.haxx.se
Received on 2009-09-02