Export to GitHub

lits3 - issue #6

Circular Recursive Call :: S3Service.GetObject(string bucketName, string key, Stream outputStream)


Posted on Jan 3, 2009 by Grumpy Rabbit

I'm surprised the compiler didn't pick this up, really, so I tried just to see what would happen - sure enough, crashes.

This is the implementation of the current version (Oct 21)

Current implementation:

/// <summary> /// Gets an existing object in S3 and copies its data to the given Stream. /// </summary> public void GetObject(string bucketName, string key, Stream outputStream) { GetObject(bucketName, key, outputStream); }

Using the same model you had for other methods, I fixed this with:

/// <summary> /// Gets an existing object in S3 and copies its data to the given Stream. /// </summary> public void GetObject(string bucketName, string key, Stream outputStream) { long contentLength; string contentType; using (Stream objectStream = GetObjectStream(bucketName, key, out contentLength, out contentType)) CopyStream(objectStream, outputStream, contentLength); }

Comment #1

Posted on Jan 6, 2009 by Massive Ox

Whoops, good catch - will commit your fix soon.

Comment #2

Posted on Feb 18, 2009 by Massive Ox

Fixed in svn.

Status: Fixed

Labels:
Type-Defect Priority-Medium