perkeep/pkg
mpl 6f5a718ad1 cmd/camget: update client share chain when getting blobs from cache
When fetching shared blobs, we rely on the share chain to verify if a
blob can be reached. This chain is updated whenever we fetch an
additional link of the chain, by updating the Client.via map. However,
when some blobs of the chain are already cached in camget's DiskCache,
because we get them from the cache, we don't fetch them with
Client.FetchVia, which means the Client.via map isn't updated. And thus
the chain is broken.

This change adds Client.UpdateShareChain, and sets it as a hook to be
called by the CachingFetcher in the event of a cache hit. That way, we
ensure that the share chain is updated even when we get blobs from the
cache (instead of from the Client).

We also add a mutex to guard Client.via, because it is accessed by
concurrent smartFetch calls in case of a static-set.

As FetchVia was undocumented and not used by anyone, I made it
unexported. We can always export it again later when needed.

Fixes #856

Change-Id: I767cbec4b6f382cbccc25c0b97782b2a7472deb8
2016-09-26 19:03:04 +02:00
..
app pkg/server/app: proxy search requests for publisher 2016-08-29 19:14:19 +02:00
auth webUI: disable tokenAuth when auth is None 2016-06-28 01:56:08 +02:00
blob Move remaining stuff in third_party/* to vendor/* 2016-04-20 16:49:15 -07:00
blobserver vendor: rename google.golang.org/cloud to cloud.google.com/go 2016-09-08 15:14:12 +02:00
buildinfo add canonical import paths 2016-03-13 19:57:14 -07:00
cacher cmd/camget: update client share chain when getting blobs from cache 2016-09-26 19:03:04 +02:00
camerrors add canonical import paths 2016-03-13 19:57:14 -07:00
camlegal add canonical import paths 2016-03-13 19:57:14 -07:00
client cmd/camget: update client share chain when getting blobs from cache 2016-09-26 19:03:04 +02:00
cmdmain Delete misc unused objects 2016-04-06 17:59:51 +02:00
constants pkg/constants/google: remove, use oauth2/google instead 2016-06-08 16:15:39 -07:00
conv add canonical import paths 2016-03-13 19:57:14 -07:00
deploy/gce vendor: rename google.golang.org/cloud to cloud.google.com/go 2016-09-08 15:14:12 +02:00
env vendor: rename google.golang.org/cloud to cloud.google.com/go 2016-09-08 15:14:12 +02:00
fileembed server: fall back to serving UI resources from GOPATH as last resort 2016-05-06 16:05:22 -07:00
fs pkg/fs: take At into account for (root)dirs 2016-08-01 18:45:26 +02:00
gc add canonical import paths 2016-03-13 19:57:14 -07:00
geocode add canonical import paths 2016-03-13 19:57:14 -07:00
googlestorage vendor: rename google.golang.org/cloud to cloud.google.com/go 2016-09-08 15:14:12 +02:00
hashutil add canonical import paths 2016-03-13 19:57:14 -07:00
httputil pkg/httputil: fix checkSystemRoots for Go1.6 2016-04-05 00:18:16 +02:00
images add canonical import paths 2016-03-13 19:57:14 -07:00
importer importer/pinboard: fix test 2016-06-03 23:08:15 +02:00
index Merge "search: add location info to DescribedBlob" 2016-09-16 19:34:00 +00:00
jsonsign Merge "server/camlistored: upload gpg key blob on startup" 2016-04-25 22:43:38 +00:00
kvutil Move remaining stuff in third_party/* to vendor/* 2016-04-20 16:49:15 -07:00
leak add canonical import paths 2016-03-13 19:57:14 -07:00
lru add canonical import paths 2016-03-13 19:57:14 -07:00
magic pkg/index: use mime.TypeByExtension to record MIMEType 2016-09-06 16:26:09 +02:00
media add canonical import paths 2016-03-13 19:57:14 -07:00
misc path fixes for third_party move 2016-04-21 12:25:17 -07:00
netutil app/publisher: infinite scrolling of set members 2016-07-15 00:34:52 +02:00
osutil vendor: rename google.golang.org/cloud to cloud.google.com/go 2016-09-08 15:14:12 +02:00
pools add canonical import paths 2016-03-13 19:57:14 -07:00
publish app/publisher: file rendering and navigation with jquery 2016-07-19 16:37:35 +02:00
readerutil Delete misc unused objects 2016-04-06 17:59:51 +02:00
rollsum add canonical import paths 2016-03-13 19:57:14 -07:00
schema app/publisher: infinite scrolling of set members 2016-07-15 00:34:52 +02:00
search Merge "search: add location info to DescribedBlob" 2016-09-16 19:34:00 +00:00
server vendor: rename google.golang.org/cloud to cloud.google.com/go 2016-09-08 15:14:12 +02:00
serverinit vendor: rename google.golang.org/cloud to cloud.google.com/go 2016-09-08 15:14:12 +02:00
sorted vendor: rename google.golang.org/cloud to cloud.google.com/go 2016-09-08 15:14:12 +02:00
test Merge "search: add location info to DescribedBlob" 2016-09-16 19:34:00 +00:00
types Merge "search: add location info to DescribedBlob" 2016-09-16 19:34:00 +00:00
video/thumbnail add canonical import paths 2016-03-13 19:57:14 -07:00
webserver pkg/webserver: force tls MinVersion to TLS1.2 2016-07-19 17:38:46 +02:00
.gitignore Update from r60 to [almost] Go 1. 2012-02-18 21:53:06 -08:00