cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem with my class in independents threads- Error: "Failure when receiving data from the peer"

From: Denis Bondarev <asterganster_at_gmail.com>
Date: Mon, 27 Jul 2009 02:57:40 +0300

Very -Very thanks!!! Your coments is very actual and real help!!! It is my
mistake that I a not read documentation is full. Yes your true- I very love
DELETE operations because no want when memory is gone more and more...:-),
but in this situation I see that it is mistake too...

Best regards from me.
Denis.

>
> > The 1st mistake I spotted here. You call curl_global_cleanup() on each
> > request. You should call it exactly once as described here:
> >
> > http://curl.haxx.se/libcurl/c/curl_global_cleanup.html
> >
> > ... and of course call curl_global_init() before you start to use libcurl
> > (also once).
> >
> > > return table;
> > > delete curl;
> >
> > Why are you calling C++ delete operator on curl easy handle?
>
> >Now looking again I see it's behind the return statement :-) The example
> >definitely needs some cleanup. Anyway don't try to call the C++ delete
> >on curl easy handle ... and under no circumstances on the local variables
> >and arguments allocated on stack. The sequence of delete operators is
> >completely nonsense.
>
> Kamil
>
Received on 2009-07-27