cURL / Mailing Lists / curl-library / Single Mail


Re: HTTP client as new child process

From: Daniel Stenberg <>
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.


List admin:

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