Merge lp:~julian-edwards/gwacl/fix-block-lengths into lp:gwacl
Proposed by
Julian Edwards
Status: | Merged |
---|---|
Approved by: | Julian Edwards |
Approved revision: | 210 |
Merged at revision: | 210 |
Proposed branch: | lp:~julian-edwards/gwacl/fix-block-lengths |
Merge into: | lp:gwacl |
Diff against target: |
42 lines (+7/-5) 2 files modified
storage.go (+2/-0) storage_test.go (+5/-5) |
To merge this branch: | bzr merge lp:~julian-edwards/gwacl/fix-block-lengths |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raphaël Badin (community) | Approve | ||
Review via email: mp+178522@code.launchpad.net |
Commit message
Ensure consistent block lengths when uploading large files.
To post a comment you must log in.
Looks good.
[0]
8 + // Block IDs must be a consistent length, so pad it out. "%030s" , blockID)
9 + blockID = fmt.Sprintf(
I was just wondering about the choice of "30" here but I guess it does not really matter. Maybe worth turning it into a private variable though, especially if you do what I suggest in [1].
[1]
21 - assertBlockSent(c, context, data, b64("0"), transport. Exchanges[ 0]) 000000000000000 00000") , transport. Exchanges[ 0])
22 + assertBlockSent(c, context, data, b64("0000000000
etc.
Using strings.Repeat would be a bit more elegant here.