cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: java/curl DNS issue on Linux

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 26 Oct 2006 13:25:23 -0700

On Thu, Oct 26, 2006 at 02:17:06PM -0500, Mann, Bryan wrote:
> I am attempting to use www.swig.org and libcurl(7.15.5) to create a more
> extensive java for curl binding on Linux(knoppix 3.4) than what I find
> on the Net.
>
> To test my "binding" I have re-written simple.c into simple.java and am
> getting a CURLE_COULDNT_RESOLVE_HOST error.
>
> In the interest of working through the problem I have tested and
> verified that my JNI code receives valid values.
>
> I also have verified that the requested hostname is completely mangled
> via tcpdump.

What's the lifetime of the URL you pass in to CURLOPT_URL? The string
pointed to by that pointer must exist until the libcurl transfer is complete.
If the string is being garbage-collected before the transfer is done,
that would explain what you're seeing. Many other curl_easy_setopt options
have the same requirement.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2006-10-26