cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Libcurl debug info

From: Prasanna Mohanty <mkprasanna_at_hotmail.com>
Date: Wed, 1 Sep 2010 05:30:13 +0000

 

 

> Date: Wed, 1 Sep 2010 00:27:15 +0100
> From: neocarlitos_at_yahoo.com.mx
> To: curl-library_at_cool.haxx.se
> Subject: Re: Libcurl debug info
>
> >> I'm migrating the examples from the C API to java. I ran into a
> >> problem while migrating sepheaders.c. Basically, I can manage to write
> >> data to body.out, OR to head.out but when I try them together, program
> >> crashes. Is there a way to print debugging information before
> >> curl_easy_perform is called, so I can see what I'm doing wrong?
> >
> > The code running before curl_easy_perform() is called, is your code
> > isn't it? Or at least the java binding code? Then just sprinkle it with
> > printfs or whatever. Or use a debugger. I think I must've misunderstood
> > the question...
> >
>
> Sorry, I think I wasn't very clear on my previous post. Basically what
> I'm doing is writing java code which calls the C functions
> (curl_easy_setopt(), curl_easy_perform(), etc) via JNI. After creating
> the curl handle using curl_easy_init() and setting up several options
> via curl_easy_setopt(), we are ready to go but... the program is
> crashing when the C function curl_easy_perform.
>
> I've got (lots) of printfs all over the place (both in Java and C code).
> It seems as if I'm setting some option which perform() doesn't like
> and causes the crash. I would like to know if there is a way to print
> the 'options currently set' in a handle:
>
> curl_easy_printDebug(curl_handle);
>
> handle.url -> "http://curl.haxx.se"
>
> However, am I right to think that setting option CURLOPT_VERBOSE should
> do something very similar?
>
> Many thanks,
> neocarlitos
Hello,
Following url describes various options that can be set. You can check if any in compatible options
being set in your program.
http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
Verify if you are calling curl_global_init and later on the *_cleanup.
http://curl.haxx.se/libcurl/c/curl_easy_init.html
Since you mentioned the program is crashing your printfs should catch it.
Thanks
Prasanna
 
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
                                               

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-09-01