cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl crash with CURLOPT_HTTPPOST

From: <bob_at_jerand.com>
Date: Tue, 9 Dec 2003 17:20:07 -0500

This is my first program using cURL. I am impressed with the program.

I am having trouble using a multi-part form post and curl 7.10.8. This is running on Windows 2000 Professional.

I have set various options: CURLOPT_URL, CURLOPT_ERRORBUFFER, CURLOPT_HTTP_VERSION_1_0 (and CURLOPT_HTTP_VERSION_1_1), CURLOPT_VERBOSE, CURLOPT_DEBUGFUNCTION.

I am using curl_formadd() to build the message.

If I use curl_easy_setup (session, CURLOPT_HTTPPOST, NULL) followed by curl_easy_perform() everything works; no POST is generated but instead a GET. If I use curl_easy_setup (session, CURLOPT_POSTFIELDS, data), again, everything works. However, when using curl_easy_setup (session, CURLOPT_HTTPPOST, postForm), the program crashes. I have dumped the contents of the postForm and as far as I can tell, it looks good. One indication is that the DEBUGFUNCTION is called with a type 2753 (not one of the 5 expected: TEXT, HDR IN, HDR OUT, DATA IN, DATA OUT). The headers look OK. But when the program returns (returning 0), it then crashes.

The following is the output from the program (trace info includes source line number and file name.

F(in) : Working in ecmxXferCurlDebug() [41(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
V(ptr): in ecmxXferCurlDebug(): curl = {0C1A0048} [52(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
V(str): in ecmxXferCurlDebug(): typeSize = {Type=TEXT Size=45} [54(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
V(ptr): in ecmxXferCurlDebug(): msg = {0503ECE8} [55(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
V(str): in ecmxXferCurlDebug(): msg = {About to connect() to pdmdeva1.llnl.gov:7011
} [57(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
F(out): Return from ecmxXferCurlDebug() [58(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
F(in) : Working in ecmxXferCurlDebug() [41(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
V(ptr): in ecmxXferCurlDebug(): curl = {0C1A0048} [52(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
V(str): in ecmxXferCurlDebug(): typeSize = {Type=TEXT Size=58} [54(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
V(ptr): in ecmxXferCurlDebug(): msg = {0503ED38} [55(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
V(str): in ecmxXferCurlDebug(): msg = {Connected to pdmdeva1.llnl.gov (128.115.132.55) port 7011
} [57(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
F(out): Return from ecmxXferCurlDebug() [58(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
F(in) : Working in ecmxXferCurlDebug() [41(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
V(ptr): in ecmxXferCurlDebug(): curl = {0A0D3034} [52(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
V(str): in ecmxXferCurlDebug(): typeSize = {Type=UNK2573 Size=270} [54(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
V(ptr): in ecmxXferCurlDebug(): msg = {0C1A8478} [55(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
V(str): in ecmxXferCurlDebug(): msg = {POST /html.jsp HTTP/1.0

Host: pdmdeva1.llnl.gov:7011

Pragma: no-cache

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

Content-Length: 152

Expect: 100-continue

Content-Type: multipart/form-data; boundary=----------------------------9591de07ac40

} [57(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]
F(out): Return from ecmxXferCurlDebug() [58(F:\users\pro_work\llnl\ecms1\ecmsXfer.c)]

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Received on 2003-12-10