cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP client as new child process

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 19 Feb 2013 11:22:09 +0100 (CET)

On Tue, 19 Feb 2013, Ajay Tanpure wrote:

Please. Don't top-post nor full-quote.

> But in case of child process, as have mentioned below, functions like
> curl_easy_setopt(), didn't get called.

Sure they do. libcurl cannot prevent your code from calling the functions. If
they don't get called then the problem is not caused by libcurl itself!

> I have searched on web also regarding that, global_init() is NOT thread
> safe.

You don't have to search the web for that, just read the libcurl docs. And no,
it isn't thread-safe. But then fork() doesn't start a new _thread_ either...

> I am using libcurl version 7.9.6

REALLY? I suspect that's not correct. 7.9.6 is over 10 years old. I think
you're using 7.19.6, not exactly the same thing. Please pay (more) attention
to details.

> [incomplete example]

Your example didn't build as it was incomplete. I did however amuse myself by
converting it into a working code example and what do you know? It works for
me... See the attachment.

-- 
  / daniel.haxx.se


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

  • TEXT/x-csrc attachment: fork.c
Received on 2013-02-19