cURL / Mailing Lists / curl-library / Single Mail

curl-library

"Send failure: Operation not supported on socket" when doing a HTTP POST

From: Krishna Chaithanya Muthyala <chetan.eee_at_gmail.com>
Date: Fri, 26 Feb 2010 15:44:09 +0530

Hi,

I am trying to do a HTTP POST to an IIS server.

I am including some string fields, some jpg files as well as some kind
of info about the files sent.

String fields are sent using
curl_formadd(&formpost,
                    &lastptR,
                    CURLFORM_COPYNAME,"abc",
                    CURLFORM_PTRCONTENT, "ABC",
                    CURLFORM_END);
And jpg files are sent using
 curl_formadd(&formpost,
                    &lastptR,
                    CURLFORM_COPYNAME,"xyz",
                    CURLFORM_FILE,"file1"
                    CURLFORM_CONTENTTYPE, "image/jpeg",
                    CURLFORM_END);
And information about files is sent using
 curl_formadd(&formpost,
                    &lastptR,
                    CURLFORM_COPYNAME,"ijk",
                    CURLFORM_BUFFER, "md",
                    CURLFORM_BUFFPTR, "file1,file2,file3,file4,file5",
                    CURLFORM_BUFFERLENGTH,
strlen("file1,file2,file3,file4,file5"),
                    CURLFORM_END);

I am able to send the post successfullly when there are less files. But,
when I do it for more number of files, I get "500 Internal Server Error" and
libcurl debug output shows the message

* Send failure: Operation not supported on socket
* Closing connection #0
* Failed sending data to the peer

Is there any limitation when we send the data as a buffer? Without that
buffer, I am able to send as many files as I can.

Thanks for the help!

Thanks and Regards,
krishna

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