curl-library
Re: curl crash using multiple muti-handles when resolve host failed.
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 15 May 2008 07:59:35 +0200 (CEST)
Date: Thu, 15 May 2008 07:59:35 +0200 (CEST)
On Thu, 15 May 2008, Du xiaoyu wrote:
> int running = 1;
> while (running) {
> res = (int)curl_multi_perform(m, &running);
> printf("mutil ret code %s\n", curl_multi_strerror(res));
> if (running <= 0) {
> fprintf(stderr, "nothing left running.\n");
> pthread_exit(0);
> break;
> }
> }
This code will busy-loop the thread like crazy while the transfer is going and
then it'll leak memory once the transfer is complete.
I suggest you read the docs more and check out some examples.
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.htmlReceived on 2008-05-15