cURL / Mailing Lists / curl-library / Single Mail

curl-library

Strange intermittent problems with libcurl. A new problem with 7.20.8 only

From: Andreas Falco <andreasfalco_at_hotmail.com>
Date: Mon, 01 Dec 2003 12:58:59 -0800

The original problem seems to be solved, but a new problem found with
version 7.10.8

I am almost sure I have found the cause to my intermittent errors thanks to
the seemingly much better debug support in version 7.10.8. I am not
completely sure because very rarely error #56 still occurs, but I think I
can live with it.

The problem was in the lines:

    /* if we don't provide POSTFIELDSIZE, libcurl will strlen() by
       itself */
    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, strlen(postthis));

From the explanation in the comment I thought that I have to enter strlen()
here.
I changed it to include the ending zero

    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, strlen(postthis)+1);

and everything seems to be solved for 7.10.7!

But a new problem aroses with ver. 7.10.8. It does not post my data!

The server I want data sent back from is a perl script:
                "https://www.my.server/cgi-bin/lp.cgi"
The data I want to post is
               user=user_name&pwd=password&file=file_name&dest=@CF01
version 7.10.7 posts the data 7.10.8 does not post it! here is the relevant
part of the debug info for

7.10.7 (which works)
-----------------------------------------------------------------------------
CURL -header out:
POST /cgi-bin/lp.cgi HTTP/1.1
Proxy-authorization: Basic aGFtbWVyOmFhYWFh
Host: www.opten.hur
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Content-Length: 55
Content-Type: application/x-www-form-urlencoded
CURL: sent protocol data:
    0000 75 73 65 72 3D 78 78 78 78 78 26 70 77 64 3D 78 user=xxxxx&pwd=x
    0010 78 78 78 78 78 78 78 25 32 30 74 26 66 69 6C 65 xxxxxxx%20t&file
    0020 3D 65 78 65 75 70 64 2E 64 61 74 26 64 65 73 74 =exeupd.dat&dest
    0030 3D 40 43 46 30 31 00 =@CF01.
CURL - header in:
HTTP/1.1 200 OK
CURL - header in:
Date: Mon, 01 Dec 2003 19:23:54 GMT
CURL - header in:
Server: Apache-AdvancedExtranetServer/2.0.47 (Mandrake Linux/1.3.91mdk)
mod_ssl/2.0.47 OpenSSL/0.9.7a PHP/4.3.1
CURL - header in:
Content-Length: 27
CURL - header in:
Content-Type: text/html; charset=ISO-8859-1
CURL: received protocol data:
    0000 4E 69 6E 63 73 20 6A 6F 67 6F 73 75 6C 74 73 E1 Nincs.jogosults▀
    0010 67 61 20 62 65 6C E9 70 6E 69 21 ga.bel┌pni!
CURL - text:
Connection #0 left intact
CURL - text:
Closing connection #0
-----------------------------------------------------------------------------------------------------------------
The same data from 7.10.8
-----------------------------------------------------------------------------------------------------------------
CURL -header out:
POST /cgi-bin/lp.cgi HTTP/1.1
Host: www.opten.hu
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
CURL - header in:
HTTP/1.1 200 OK
CURL - header in:
Date: Mon, 01 Dec 2003 20:24:57 GMT
CURL - header in:
Server: Apache-AdvancedExtranetServer/2.0.47 (Mandrake Linux/1.3.91mdk)
mod_ssl/2.0.47 OpenSSL/0.9.7a PHP/4.3.1
CURL - header in:
Content-disposition: attachment;filename=
CURL - header in:
Content-Length: 0
CURL - header in:
Content-Type: application/xyz
CURL - text:
Connection #0 left intact
CURL - text:
Closing connection #0
-------------------------------------------------------------------------------------------------
The program is the same in both cases only the dlls differes:
for 7.10.7
  2003.01.28 23:15 159,744 libcurl.dll
  2002.12.06 10:12 663,552 LIBEAY32.DLL
  2003.04.02 13:19 177,664 LIBSSL32.DLL
  2002.12.06 10:12 159,744 SSLEAY32.DLL
and for 7.10.8
  2003.11.03 10:09 217,837 libcurl.dll
  2003.10.01 23:26 843,776 libeay32.dll
  2003.12.01 17:37 159,744 libssl32.dll
  2003.10.01 23:26 159,744 ssleay32.dll

I have already posted the relevant part of my program here.

                            Andreas

_________________________________________________________________
Gift-shop online from the comfort of home at MSN Shopping! No crowds, free
parking. http://shopping.msn.com

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
Received on 2003-12-02