aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/manifest.go
diff options
context:
space:
mode:
authorJanos Guljas <janos@resenje.org>2017-12-13 17:23:11 +0800
committerJanos Guljas <janos@resenje.org>2017-12-13 17:40:39 +0800
commit19982f946735948478b6b7e7706f1b615f171d0d (patch)
treecbacbdb6f9e6e731c2ebc17bad74e875f4d8ea8b /swarm/api/manifest.go
parent1dc19de5da64962a98a37bbc7b93a3895d2eb6e6 (diff)
parent32516c768ec09e2a71cab5983d2c8b8ae5d92fc7 (diff)
downloaddexon-19982f946735948478b6b7e7706f1b615f171d0d.tar
dexon-19982f946735948478b6b7e7706f1b615f171d0d.tar.gz
dexon-19982f946735948478b6b7e7706f1b615f171d0d.tar.bz2
dexon-19982f946735948478b6b7e7706f1b615f171d0d.tar.lz
dexon-19982f946735948478b6b7e7706f1b615f171d0d.tar.xz
dexon-19982f946735948478b6b7e7706f1b615f171d0d.tar.zst
dexon-19982f946735948478b6b7e7706f1b615f171d0d.zip
swarm, cmd/swarm: Merge branch 'master' into multiple-ens-endpoints
Merge with changes that implement config file PR #15548. Field *EnsApi string* in swarm/api.Config is replaced with *EnsAPIs []string*. A new field *EnsDisabled bool* is added to swarm/api.Config for easy way to disable ENS resolving with config file. Signature of function swarm.NewSwarm is changed and simplified.
Diffstat (limited to 'swarm/api/manifest.go')
-rw-r--r--swarm/api/manifest.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/swarm/api/manifest.go b/swarm/api/manifest.go
index 32b5f80a7..685a300fc 100644
--- a/swarm/api/manifest.go
+++ b/swarm/api/manifest.go
@@ -436,6 +436,16 @@ func (self *manifestTrie) findPrefixOf(path string, quitC chan bool) (entry *man
if len(path) <= epl {
if entry.Path[:len(path)] == path {
if entry.ContentType == ManifestType {
+ err := self.loadSubTrie(entry, quitC)
+ if err == nil && entry.subtrie != nil {
+ subentries := entry.subtrie.entries
+ for i := 0; i < len(subentries); i++ {
+ sub := subentries[i]
+ if sub != nil && sub.Path == "" {
+ return sub, len(path)
+ }
+ }
+ }
entry.Status = http.StatusMultipleChoices
}
pos = len(path)