Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

uploadNextChunkWithOffset:fetcherProperties is bugged for offset and content-range interpretation #9

Closed
GoogleCodeExporter opened this issue Apr 16, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. upload a zero byte length file

What is the expected output? What do you see instead?
Expected: upload is fine
Actual: Assertion triggered at line 471

What version of the product are you using? On what operating system?
Google API client library, iOS 6

Please provide any additional information below.
The assertion should be "offset <= dataLen" instead of "offset < dataLen"
For the Content-Range value implementation, it should be
    if(thisChunkSize)
      rangeStr = [NSString stringWithFormat:@"bytes %llu-%llu/%llu",
                  (unsigned long long)offset,
                  (unsigned long long)(offset + thisChunkSize - 1),
                  (unsigned long long)dataLen];
    else
      rangeStr = @"bytes */0";
 instead of just
      rangeStr = [NSString stringWithFormat:@"bytes %llu-%llu/%llu",
                  (unsigned long long)offset,
                  (unsigned long long)(offset + thisChunkSize - 1),
                  (unsigned long long)dataLen];
to produce valid value even for zero-length Content-Length

Original issue reported on code.google.com by vinceplu...@gmail.com on 29 Jul 2013 at 1:13

@GoogleCodeExporter
Copy link
Author

I upload the file using Google Drive api for Objective-C on iOS, [GTLQueryDrive 
queryForFilesInsertWithObject:uploadParameters:]

Original comment by vinceplu...@gmail.com on 29 Jul 2013 at 1:17

@GoogleCodeExporter
Copy link
Author

Original comment by grobb...@google.com on 2 Aug 2013 at 2:14

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

This has been fixed. Thank you for pointing out the issue.

https://code.google.com/p/gtm-http-fetcher/source/detail?r=128

Original comment by grobb...@google.com on 2 Aug 2013 at 5:47

  • Changed state: Fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant