cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Plea for help

From: Paul Johnson <paul_at_applewoodhouse.com>
Date: Wed, 16 Jul 2003 14:45:08 +0100

I've not tried with the command line tool, but I have found an alternative.
If I target my own website, I get the 52 message back straight away all the
time which implies two things:

1) The server guy is indeed not behaving properly. Maybe he has a
ludicrous timeout period or something.

2) I'm also doing something wrong because I'm somehow not managing to
send any data. I find this a bit distressing atm as the sample code for http
post has only about 3 real lines in it and I can't make mine happen at all.
lol

Regards,
Paul Johnson
Applewood House
www.applewoodhouse.com

----- Original Message -----
From: "Ralph Mitchell" <rmitchell_at_eds.com>
To: <curl-library_at_lists.sourceforge.net>
Sent: Wednesday, July 16, 2003 2:14 PM
Subject: Re: Plea for help

> Just wondering... Have you tried to upload using command-line curl?
> Did it work? If so, can you run some kind of network monitor to see
> what it does and compare it to your program? not calling your server
> guy a liar, but if you can't get through from the command line, you can
> expect similar results from your program...
>
> Apologies if this has already been discussed - I've skipped a few posts
> recently due to overwork...
>
> Ralph Mitchell
>
>
> Paul Johnson wrote:
>
> >OK, this is doing my head in now. I've spent the last four days looking
at
> >this 52 problem and everything I've changed makes no difference. The
server
> >guy keeps telling me no data is being sent via my post and curl only
seems
> >to come back after the post when I do a raindance.
> >
> >Looks like I was very wrong about me spending my time writing the app
> >instead of the transport layer. I've even run all this through
> >BoundsChecker.
> >
> >I turned on verbose output and called AllocConsole() and don't see
anything
> >at all in the console window. I'm starting to think I'm jinxed.
> >
> >I'm a complete novice at this so anything could be going wrong. I've
> >attached some code below that is my latest incarnation. If some kind soul
> >can find a glaring mistake in this I'd be eternally grateful.
> >
> >I tried doing a single part post using the postfields options (an no
> >formadd) but with the same odd result btw.
> >
> >The alleged posting code:
> >
> > curl_easy_setopt(curl,CURLOPT_READFUNCTION,ReadBody);
> > curl_easy_setopt(curl,CURLOPT_UPLOAD,TRUE);
> >// curl_easy_setopt(curl,CURLOPT_POSTFIELDSIZE,FileSize);
> >// curl_easy_setopt(curl,CURLOPT_POSTFIELDS,MoveFileMem);
> >
> > curl_formadd(&post, &last,
> > CURLFORM_COPYNAME,"move file",
> > CURLFORM_CONTENTSLENGTH,FileSize,
> > CURLFORM_PTRCONTENTS,MoveFileMem,
> > CURLFORM_END);
> >
> > curl_easy_setopt(curl,CURLOPT_HTTPPOST,post);
> >
> > ReadPtr=NULL;
> > BytesLeft=FileSize;
> > res=curl_easy_perform(curl);
> >
> >-------------------------------------
> >
> >size_t ReadBody (void *buffer, size_t size, size_t nmemb, void *userp)
> >{
> >tS32 Size;
> >
> > Size=size*nmemb;
> >
> > BytesLeft-=Size;
> > if (BytesLeft<0)
> > {
> > Size+=BytesLeft;
> > BytesLeft=0;
> > }
> >
> >
> > if (!ReadPtr)
> > ReadPtr=MoveFileMem;
> >
> > if (Size)
> > {
> > KickProgressBar(Size);
> > memcpy(buffer,ReadPtr,Size);
> > ReadPtr+=Size;
> > }
> >
> > if (Size)
> > return (Size);
> > else
> > return (0);
> >}
> >
> >
> >
> >
> >Regards,
> >Paul Johnson
> >Applewood House
> >www.applewoodhouse.com
> >
> >
> >
> >-------------------------------------------------------
> >This SF.net email is sponsored by: VM Ware
> >With VMware you can run multiple operating systems on a single machine.
> >WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
> >same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
> >
> >
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a single machine.
> WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
> same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
>
>

-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
Received on 2003-07-16