Win32 Libcurl 7.13 - curl_easy_init always returns null
Date: Wed, 14 Feb 2007 11:50:05 -0000
In order to send HTTP posts, as per the title of this post, I am
currently using a Win32 build of Libcurl 7.13.
I am currently working in .NET 1.1 (service pack 1) and use C# as the
primary language, I am also using the Libcurl.NET from here:
After running a series of tests I found an intermittent error where I
would get a "no internal easy handle" exception returned back to the
main application. After some investigation I also found that on a few
machines I would get the same error and the code would never work.
So in an effort to find the issue I started to strip out code and
created various test applications and ultimately ended up with the
following incredibly simple piece of code (which does not use the
Libcurl.NET library at all):
internal static extern IntPtr curl_easy_init();
static void Main(string args)
IntPtr x = curl_easy_init();
On machines that work reliably this outputs the handle returned from the
curl_easy_init call, on machines that fail this always returns 0.
According to the document located here:
If the function call returns 0/null then "something went wrong and you
cannot use other curl functions", this has left me at a dead end as I
don't seem to have any method of finding out what "something" is.
As hinted at above this issue is per machine, i.e. on some machines it
works fine every time, on others the exact same code fails every time.
Does anybody have any suggestions as to a possible cause/solution?
p.s. Whilst working on this issue I have also found another interesting
problem, in intermittently the handle seemingly disappears from memory.
As an example, using the Libcurl.NET library I use the following code:
DotNetCurl.Easy easy = new DotNetCurl.Easy();
... Various other set opt calls
CURLcode cc = easy.Perform();
When the Perform function is called I receive a "no internal easy
handle" exception, which is odd as this is generated by an EnsureHandle
call within the Libcurl.NET library (this checks a static value that
should contain the handle returned from the curl_easy_init call
performed during the Easy constructor). Interesting when calling the
SetOpt functions this EnsureHandle method is also called, therefore the
handle must be present during SetOpt calls otherwise I would get the
This I believe is probably an issue for the Libcurl.NET library and
therefore is beyond the scope of this mailing list, however it may help
to shed a little more information on the primary issue described above.
Received on 2007-02-14