ashukhobragade / gtm-http-fetcher

Automatically exported from code.google.com/p/gtm-http-fetcher
Other
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 commented 9 years ago
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 commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
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