cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

Re: multi_threads

From: Brian Dessent <brian_at_dessent.net>
Date: Tue, 06 Dec 2005 13:00:01 -0800

Yi Li wrote:

> void *pull_one_url(void *)
> {
>
> CURL *curl; /// HMMM
> ...
> while(true){
>
> //get url
> pthread_mutex_lock(&locker);
> if(!fgets(line,4096,input)){
> curl_easy_cleanup(curl); /// <-- OUCH

If the stream is already at EOF when this code runs for the first time
in a given thread then you end up calling curl_easy_cleanup() on the
uninitialized variable which is undefined behavior.

Brian
Received on 2005-12-06

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET