cURL / Mailing Lists / curl-library / Single Mail

curl-library

AW: C API questions

From: Robert Barsch - x:act Developer Team <robert.barsch_at_x-act.org>
Date: Wed, 4 Dec 2002 17:04:52 +0100

Hi Daniel,

> libcurl will not allow you to do multi-part formposts easily without size
> limits. The multipart formpost stuff in libcurl requires that the
> full post
> is contructed in memory before it is sent off...

so it depends on your memory size

>
> > As far I understood the examples there is no possibility for
> > streaming/using sockets
>
> I don't understand what you mean.

you can't stream like with sockets - there I could send byte for byte - it
just doesnt matter
how big the file size is

> > which (as far as I know) are restricted to 64k in pure C.
>
> They are not. You must be confusing C with something else! ;-)

maybe :) - so I think I lack i bit of C knowledge in here - just give me a
hint how to
make such a huge buffer lets say for a 20mb xml attachment
(as far I know you can only allocate max. 64k memory with malloc)

> What are you working around? Why can't you just convert your working PHP
> program into a C program doing the same thing? The interfaces are very
> similar using either language.

cause I still think I get in trouble with this filesize!

>
> > Guess CURLOPT_CUSTOMREQUEST wont work in this case anymore...
>
> To do what?

the php client sends the self generated http post (see last posting) and
sends it
over CURLOPT_CUSTOMREQUEST - so I didn't have to change to much - lazy me :)
There I don't have to watch the file size.

> I don't think you really want the CURLOPT_CRLF, or do you?

just testing

> > headers = curl_slist_append(headers, "Host: www.x-act.org");
>
> libcurl would make its own Host: header, you don't need to provide it
> yourself.

ditto - the webservice reacts sometimes strange of some http requests - so
if I don't overwrite the host it looks a bit different as he may expect
- just want to make sure it does not depend on this little line

> 2. Since you have a pretty clear understanding and exact wishes
> of what you
> want to send away, why don't you just create a big pre-formatted buffer
> that looks the way you want it and do a regular POST with it? Set
> CURLOPT_POST and then provide all post-data with a normal read
> callback.

cause of the memory issue - to send the whole pre-formatted buffer is no
problem :)

so maybe somebody gives me a hint...

Regards,

Robert

-------------------------------------------------------
This SF.net email is sponsored by: Microsoft Visual Studio.NET
comprehensive development tool, built to increase your
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
Received on 2002-12-04