cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Calls to srand() in Curl_FormBoundary()

From: Michael Wood <esiotrot_at_gmail.com>
Date: Wed, 10 Jun 2009 17:55:51 +0200

On Wed, Jun 10, 2009 at 12:06 AM, Daniel Stenberg<daniel_at_haxx.se> wrote:
> On Tue, 9 Jun 2009, Tetetest wrote:
>
>> I suggest to remove the call to srand() altogether, and give the
>> application developer a chance to seed the random number generator.
>
> But removing it all together, now, could make it totally unseeded for
> current apps. Wouldn't it be good enough to move the srand() call to the
> curl_global_init() function?

That would be better than the current situation, but if the app also
calls srand() itself then curl's call to srand might interfere with
it. I suppose the workaround would be to call srand() after
curl_global_init().

-- 
Michael Wood <esiotrot_at_gmail.com>
Received on 2009-06-10