Skip to content

Commit

Permalink
[Blob][Fix][ShortRead]Read the Remainder Until We Have Expected Bytes…
Browse files Browse the repository at this point in the history
… in Total (#600)

Basically, if x bytes are desired, but only y bytes are read,
then we should read x-y bytes next time, and keep trying to read the
remainder until we have x bytes in total.
  • Loading branch information
xiafu-msft authored May 31, 2019
1 parent b8016d9 commit 2b50f5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion azure-storage-blob/azure/storage/blob/blockblobservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def create_blob_from_stream(

# keep reading from stream util length of data >= count or reaching the end of stream
while len(data) < count and len(data_chunk) is not 0:
data_chunk = stream.read(count)
data_chunk = stream.read(count - len(data))
data += data_chunk

if len(data) < count:
Expand Down

0 comments on commit 2b50f5c

Please sign in to comment.