Problem reading from S3

Jun 7, 2011 at 10:05 PM

Hi everyone,

I have encountered a problem that the stream from AWSBlobSpec.Read() is always closed. I can still access the metadata though. I have checked out the source code and it seems that the stream is just being disposed:

using (var res = Container.Provider.S3Client.GetObject(req))
        this.ContentLength = res.ContentLength;
        this.ContentType = res.ContentType;
        this.ETag = res.ETag;
        Found = true;
        return res.ResponseStream;



Jun 7, 2011 at 10:40 PM


i'll investigate this. The res.ResponseStream is probably Dispose()'d within the res.Dispose() ?

Jun 7, 2011 at 10:46 PM

Yes, I just found this in the source code of AWSSDK inside the GetObjectResponse.Dispose method:

if (responseStream != null)
        responseStream = null;

Jun 8, 2011 at 9:36 AM

I pushed a fix, but have not yet build a nuget package from that. If you are working from the sources, you can rebuild the dll