cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Content-Length Question

From: Jim Birkenseer <jim_at_premediasystems.com>
Date: Tue, 18 Apr 2006 08:54:50 -0700

Dan,

Yes, off_t it is a long long, and CodeWarrior 9 is happy with it.

In fact, in CodeWarrior, sprintf() handles %lld just fine, so I use it to
get the long long into a string. However, libcurl redirects the sprintf()
method to call curl_msprintf in mprintf.h. So, for now, I commented out that
define so that I could use sprintf() to convert the long long into a
string--hey, I said it was a terrible hack! ;-) At any rate, I'm not doing
too much with libcurl in my current incarnation of code, so this hack will
hold me for a short while.

The reason that this was such a nasty bug for me was due to my lack of
knowledge of libcurl and HTTP. I was so focused on thinking that I had not
properly used the curl_easy_setopt() commands, I didn't think about looking
libcurl's source code!

On the bright side, I did learn a bit about the HTTP protocol and libcurl
along the way.

Sadly, I'm in the midst of a big project and I don't have the time at the
moment to see if could come up with a better fix. However, if someone would
like me to test some code that they write, I'm happy to do it.

Cheers!

-- Jim

On 4/18/06 12:56 AM, "Daniel Stenberg" <daniel_at_haxx.se> wrote:

> On Mon, 17 Apr 2006, Jim Birkenseer wrote:
>
>> I think I have tracked down the issue to be the one mentioned in this
>> thread:
>>
>> http://curl.haxx.se/mail/lib-2004-08/0101.html
>
> Argh. I had forgot all about those things. Now then come all back to me and I
> can tell you they don't feel good... :-(
>
>> I think the problem that I am experiencing is that add_bufferf() does not
>> properly handle the %lld format in CodeWarrior 9.3 on Mac OS X.
>
> Well, add_bufferf() is using vaprintf() from lib/mprintf.c so if there's a
> problem with %lld then the problem is in libcurl's printf() code.
>
> And it seems reasonable if it truly is the problem as described in that old
> posting.
>
>> I am working on a terrible hack right now to get around this problem. Does
>> anybody have any ideas on an elegant way to address this issue?
>
> Well, does your compiler have a working 'long long'? Is your 'off_t' a long
> long?
>
> We need to properly figure out what the problem is to be able to make an
> accurate and good fix!
Received on 2006-04-18