cURL / Mailing Lists / curl-library / Single Mail

curl-library

What is the best way to debug this?

From: Igor Korot <ikorot01_at_gmail.com>
Date: Sun, 15 Jul 2012 00:04:31 -0700

Hi, ALL,

Here is my code:

[code]
        struct curl_slist *post = NULL;
        char *data;
        sprintf( data, "---------------------------%x",
static_cast<unsigned int>( time( NULL ) ) );
        post = curl_slist_append( post, "Content-Type: multipart/form-data" );
        post = curl_slist_append( post, "Expect: 100-continue" );
        post = curl_slist_append( post, "Connection: keep-alive" );
        curl_easy_setopt( handle, CURLOPT_READFUNCTION, CWindowPanel::put_data );
        curl_easy_setopt( handle, CURLOPT_READDATA, &data );
        curl_easy_setopt( handle, CURLOPT_HTTPHEADER, post );
        curl_easy_setopt( handle, CURLOPT_POSTFIELDSIZE, size );
        curl_easy_setopt( handle, CURLOPT_POST, 1L );
        error = curl_easy_perform( handle );
[/code]

and here is the log output:

[quote]
> POST </my_dir>/Default.aspx HTTP/1.1
Host: xxx.xxx.xxx.xxx
Accept: */*
Content-Type: multipart/form-data
Expect: 100-continue
Connection: keep-alive
Content-Length: 35

< HTTP/1.1 100 Continue
< HTTP/1.1 500 Internal Server Error
< Cache-Control: private
< Content-Length: 4784
< Content-Type: text/html; charset=utf-8
< Server: Microsoft-IIS/7.5
< X-AspNet-Version: 4.0.30319
< X-Powered-By: ASP.NET
< Date: Sun, 15 Jul 2012 05:49:42 GMT
* HTTP error before end of send, stop sending
<
* Failed writing body (1151 != 1460)
* Closing connection #0
[/quote]

2 questions:
1. Error 500 comes in because server expects file upload.
But after 100-continue, it shouldn't give error 500, right?
2. AFAIU, "Failed writing body" error is the cause for closing
connection

Thank you.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-07-15