You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by Todd Loeber <ml...@gmail.com> on 2012/08/26 06:17:17 UTC

libdeltacloud bug fix and enhancement requests

Bug) In file curl_action.c, do_get_post_url uses strdup to copy
chunk.data, truncating binary blob content during download.

I confirmed that returning chunk.data and header_chunk.data (instead
of strduping and freeing them) allows retrieval of binary data and
incidentally avoids an unnecessary copy.  The caller is already
responsible for freeing the output parameters.

If libdeltacloud is still alive, it would be nice to have
do_get_post_url fixed so binary blobs can be downloaded.  And also,
some enhancements!

Enhancement Request 1) Replace or supplement POST with PUT for uploading files
Enhancement Request 2) Add a method for downloading blobs directly to
a file (rather than into memory).

Many thanks,

Todd

Re: libdeltacloud bug fix and enhancement requests

Posted by Francesco Vollero <ra...@gmail.com>.
Hi Chris,

On Sun, Aug 26, 2012 at 3:01 PM, Chris Lalancette <cl...@gmail.com> wrote:
> On Sun, Aug 26, 2012 at 4:34 AM, Francesco Vollero <ra...@gmail.com> wrote:
>> Hi Todd,
>>
>> On Sun, Aug 26, 2012 at 6:17 AM, Todd Loeber <ml...@gmail.com> wrote:
>>> Bug) In file curl_action.c, do_get_post_url uses strdup to copy
>>> chunk.data, truncating binary blob content during download.
>>>
>>> I confirmed that returning chunk.data and header_chunk.data (instead
>>> of strduping and freeing them) allows retrieval of binary data and
>>> incidentally avoids an unnecessary copy.  The caller is already
>>> responsible for freeing the output parameters.
>>>
>>> If libdeltacloud is still alive, it would be nice to have
>>> do_get_post_url fixed so binary blobs can be downloaded.  And also,
>>> some enhancements!
>>>
>>
>> the libdeltacloud project is not currently maintained, but we would be
>> more than pleased to see that libdeltacloud keep gaining some
>> interest, with some new "fresh" patch, so why not help us to keep this
>> project alive? :) :) :)
>
> That's actually not strictly true.  I do still maintain it, though I
> am not actively working on it.  Any patches to improve it would
> definitely be welcome.
>

Let me be more clear, the project libdeltacloud afaik is not supported
by the core team of deltacloud.

> As far as this particular issue is concerned, yeah, I see the problem
> with using strdup.  However, I don't think we can just remove the
> strdup().  I'm pretty sure I wrote it that way for a reason, though I
> honestly don't remember the reason.  My suggestion would be to change
> the strdup to a memcpy, which should fix this particular problem.  If
> you really want to remove the strdup, you would have to go through all
> of the callers of do_get_post_url and make sure that none of them
> require the duplicated data.
>
> Anyway, thanks for looking into it!
>
> Chris

Re: libdeltacloud bug fix and enhancement requests

Posted by Chris Lalancette <cl...@gmail.com>.
On Sun, Aug 26, 2012 at 4:34 AM, Francesco Vollero <ra...@gmail.com> wrote:
> Hi Todd,
>
> On Sun, Aug 26, 2012 at 6:17 AM, Todd Loeber <ml...@gmail.com> wrote:
>> Bug) In file curl_action.c, do_get_post_url uses strdup to copy
>> chunk.data, truncating binary blob content during download.
>>
>> I confirmed that returning chunk.data and header_chunk.data (instead
>> of strduping and freeing them) allows retrieval of binary data and
>> incidentally avoids an unnecessary copy.  The caller is already
>> responsible for freeing the output parameters.
>>
>> If libdeltacloud is still alive, it would be nice to have
>> do_get_post_url fixed so binary blobs can be downloaded.  And also,
>> some enhancements!
>>
>
> the libdeltacloud project is not currently maintained, but we would be
> more than pleased to see that libdeltacloud keep gaining some
> interest, with some new "fresh" patch, so why not help us to keep this
> project alive? :) :) :)

That's actually not strictly true.  I do still maintain it, though I
am not actively working on it.  Any patches to improve it would
definitely be welcome.

As far as this particular issue is concerned, yeah, I see the problem
with using strdup.  However, I don't think we can just remove the
strdup().  I'm pretty sure I wrote it that way for a reason, though I
honestly don't remember the reason.  My suggestion would be to change
the strdup to a memcpy, which should fix this particular problem.  If
you really want to remove the strdup, you would have to go through all
of the callers of do_get_post_url and make sure that none of them
require the duplicated data.

Anyway, thanks for looking into it!

Chris

Re: libdeltacloud bug fix and enhancement requests

Posted by Francesco Vollero <ra...@gmail.com>.
Hi Todd,

On Sun, Aug 26, 2012 at 6:17 AM, Todd Loeber <ml...@gmail.com> wrote:
> Bug) In file curl_action.c, do_get_post_url uses strdup to copy
> chunk.data, truncating binary blob content during download.
>
> I confirmed that returning chunk.data and header_chunk.data (instead
> of strduping and freeing them) allows retrieval of binary data and
> incidentally avoids an unnecessary copy.  The caller is already
> responsible for freeing the output parameters.
>
> If libdeltacloud is still alive, it would be nice to have
> do_get_post_url fixed so binary blobs can be downloaded.  And also,
> some enhancements!
>

the libdeltacloud project is not currently maintained, but we would be
more than pleased to see that libdeltacloud keep gaining some
interest, with some new "fresh" patch, so why not help us to keep this
project alive? :) :) :)

Cheers,
Francesco Vollero

>
> Enhancement Request 1) Replace or supplement POST with PUT for uploading files
> Enhancement Request 2) Add a method for downloading blobs directly to
> a file (rather than into memory).
>
> Many thanks,
>
> Todd