cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl crash - curl_easy_perform() ???

From: Pedro Neves <pneves_at_av.it.pt>
Date: Wed, 22 Jun 2005 00:28:50 +0100

Daniel,

Thanks for the reply. I really appreciate your help and will provide you
all the information you need to help me. Please see inline the answers
to your questions.

Daniel Stenberg wrote:

> On Tue, 21 Jun 2005, Pedro Neves wrote:
>
>> I am using libcurl to perform GET operations to an equipment. When I
>> perform the GET operations, sometimes the libcurl is blocked and my
>> program stops.
>
>
> The subject says crash, this says "stops".

Sorry for the misunderstanding. The correct word is "stop". The program
stops when libcurl is returning the code and the cursor stays blinking
in the same place.

>
> When you say "stops", you mean it returns before it is complete? If
> so, what does curl_easy_perform() return?

When I say "stop", it means that the curl_easy_perform() returns
completely and then it does not go on to the rest of the program. To
help, I paste the return code below. As you can see in the return code
shown below, the reply is complete, but the program does not go on from
this place (after </body></html> it stops).

*<head><TITLE>Packet 802.3 Address Configuration</TITLE><style
type="text/css">link,a:link,a:visited,table{font-family:Arial,Helvetica,sans-serif;font-size:12px;font-weight:bold;
text-decoration:none};body{font-family:Arial,Helvetica,sans-serif};</style><script
type="text/javascript">
function validate(){if (document.F2E.HAD.value==""){alert("Address Field
is empty");return false;}else{return true;}}</script></head><body
bgcolor=#EEEEEE text=#333366 link=#333366 vlink=#333366
alink=#007FFF><br><center><table cellpadding=0 cellspacing=0 border=0
width=95%><tr><font size=4><i>Service Flow 0 Packet 802.3 Address
Configuration</font></tr></table><hr width=95% align=center color=red
size=6><form action=C2E name=F2E><table cellspacing=0 cellpadding=3
border=0 width=95% noresize><tr><th width=150><th width=150><th
width=150><th width=150><th></th><tr><td><input type=text size=18
name=HAD value=><td colspan=2><input type=submit name=ADD value=Add
onclick="return validate()">&nbsp;&nbsp;&nbsp;&nbsp;<input type=submit
name=DEL value=Delete onclick="return
validate()">&nbsp;&nbsp;&nbsp;&nbsp;<input type=submit name=RET
value=Close onclick="window.close()">&nbsp;&nbsp;&nbsp;&nbsp;<td><table
bgcolor=#7F7F7F border=0 cellspacing=1 cellpadding=3 width=100%><tr><td
bgcolor=#F0F0F0 align=center>1 Addresses
</td></tr></table></td><tr><td>&nbsp;<td><td><td></td><tr><td><a
href=E0>00:E0:18:E0:B8:32</a><td><td><td></td><tr><td><td><td><td></td><tr><td><td><td><td>
</td><tr><td><td><td><td></td><tr><td><td><td><td></td><tr><td><td><td><td></td><tr><td>
<td><td><td></td><tr><td><td><td><td></td><tr><td><td><td><td></td><tr><td><td><td><td>
</td><tr><td><td><td><td></td><tr><td><td><td><td></td><tr><td><td><td><td></td><tr><td>
<td><td><td></td><tr><td><td><td><td></td><tr><td><td><td><td></td></tr></table></center>
</form></body></html> _/STOPS HERE/_*

It seems to me that the libcurl returns but then doesnt proceed. What do
you think?

>
>
> Please remind me, what libcurl version on what OS is this?

I am using version 7.14.0 in Linux Ubuntu with kernel 2.6.10.

>
>> Everytime I want to perform a GET operation, I am opening the file
>> file to write, and after the reception of the reply message I am
>> closing the file and performing an fflush().
>
>
> closing implies flusing, no need to make that too.
>
> And you get only the partial file? How much is missing? Does it always
> miss the same amount? Does it always miss a part?

As I mentioned, it gets all the information (as you can see in the
return code shown above) and then stops.

>
>> However, I still have the problem. I copy in this email a small part
>> of the code (sorry for this) for someone to give me a hand:
>
>
>> curl_easy_perform(handle);
>
>
> Checking return code is vital.
>
>> curl_easy_perform(handle);
>
>
> And again.
>
>> This is a small part of the program. Maybe I am doing something wrong
>> in the curl_easy_perform() function.
>
>
> Perhaps, but this little snippet doesn't tell.
>
> If you _really_ want us to help, you should make an effort to write a
> small stand-alone source code example that makes your problem appear
> when operating on a public URL. It would enable us to debug and trace
> everything easily in our ends.

I can provide you my code in a file. What do you think?

Thanks for the help.

Best Regards,
Pedro Neves
Received on 2005-06-22