deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Lutterkort <lut...@redhat.com>
Subject Re: [PATCH 1/2] Fixes for blob streaming GET /bucket/blob/content
Date Tue, 07 Aug 2012 17:50:02 GMT
On Tue, 2012-08-07 at 14:56 +0300, marios@redhat.com wrote:
> From: marios <marios@redhat.com>
> 
> 
> Signed-off-by: marios <marios@redhat.com>
> ---
>  server/lib/deltacloud/collections/buckets.rb       |    2 +-
>  server/lib/deltacloud/drivers/mock/mock_driver.rb  |    3 +++
>  .../lib/deltacloud/helpers/blob_stream_helper.rb   |   10 ++++------
>  3 files changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/server/lib/deltacloud/collections/buckets.rb b/server/lib/deltacloud/collections/buckets.rb
> index b7b3729..bb2a805 100644
> --- a/server/lib/deltacloud/collections/buckets.rb
> +++ b/server/lib/deltacloud/collections/buckets.rb
> @@ -258,7 +258,7 @@ module Deltacloud::Collections
>              @blob = driver.blob(credentials, { :id => params[:blob_id], 'bucket'
=> params[:id]})
>              if @blob
>                params['content_length'] = @blob.content_length
> -              params['content_type'] = @blob.content_type
> +              params['content_type'] = (@blob.content_type.nil? || @blob.content_type
== "")? "application/octet-stream" : @blob.content_type
>                params['content_disposition'] = "attachment; filename=#{@blob.id}"
>                BlobStream.call(self, credentials, params)
>              else
> diff --git a/server/lib/deltacloud/drivers/mock/mock_driver.rb b/server/lib/deltacloud/drivers/mock/mock_driver.rb
> index 4249a95..2f0d7eb 100644
> --- a/server/lib/deltacloud/drivers/mock/mock_driver.rb
> +++ b/server/lib/deltacloud/drivers/mock/mock_driver.rb
> @@ -388,6 +388,8 @@ module Deltacloud::Drivers::Mock
>      def blob_data(credentials, bucket_id, blob_id, opts = {})
>        check_credentials(credentials)
>        if blob = @client.load(:blobs, blob_id)
> +        #give event machine a chance
> +        sleep 1

Why is this necessary ? Is there some event we can wait for instead of
sleeping ?

David



Mime
View raw message