distribution/registry
Aaron Lehmann 6beeb935cd Avoid stat round-trips when fetching a blob
Without this commit, three round-trips are required to fetch a blob with
a progress bar. The first is a call to Stat (HEAD request), to determine
the size. Then Open is called, which also calls Stat, and finally
performs a GET request.

Only the GET request is actually needed. The size of the blob can be
sniffed from Content-Length in the GET response.

This commit changes HTTPReadSeeker to automatically detect the size from
Content-Length instead of requiring it to be passed in. The Stat call is
removed from Open because it is no longer necessary.

HTTPReadSeeker now takes an additional errorHandler callback argument which
translates an unsuccessful HTTP response into an appropriate API-level
error. Using a callback for this makes it possible to avoid leaking the
repsonse body to Read's caller, which would make lifecycle management
problematic.

Fixes #1223

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-12-02 14:21:13 -08:00
..
api Fix failing test case 2015-10-25 13:03:22 -04:00
auth De-obfuscate error message 2015-11-06 17:10:28 -08:00
client Avoid stat round-trips when fetching a blob 2015-12-02 14:21:13 -08:00
handlers Before allowing a schema1 manifest to be stored in the registry, ensure that it 2015-11-03 15:19:46 -08:00
listener [Server] Listen and serve on a unix socket 2015-05-11 16:00:14 +03:00
middleware Add pull through cache functionality to the Registry which can be configured 2015-08-04 16:09:55 -07:00
proxy Buffer writing the scheduler entry state to disk by periodically checking for 2015-10-29 11:35:52 -07:00
storage Merge pull request #1141 from lebauce/swift-no-missing-segment 2015-11-10 10:39:43 -08:00
doc.go Move initialization code from main.go to the registry package 2015-09-09 14:39:31 -07:00
registry.go Add WithVersion to context and other cleanup 2015-09-14 17:14:31 -07:00