From 7669c5b5ec5b18e96a0714d667468247a3da3d68 Mon Sep 17 00:00:00 2001 From: nolash Date: Thu, 26 Jan 2017 20:33:39 +0100 Subject: cmd/swarm, swarm/api: bzzr improve + networkid prio fixes #3444 fixes #3494 networkid override Added comments to explain why test against 0 appears twice * Command line overrides saved config, saved config overrides system default --- fixes #3476 bzzr get with path Finally a hopefully clean commit for this PR Added check for empty path to avoid SIGSEGV in path parser and resolver Added requested tests for empty path and non-existing manifest. However signature for StartHTTPServer had changed. Now it's hacked as so: StartHttpServer(api.API, &Server{Addr: "127.0.0.1:8504", CorsString: ""}) * Parse url before resolve when path and ENS is supplied, example * swarm/api/http proxy server test for retrieval of subpath through get * Removed nil entry assignment on subtrie leaf in recursive key retrieval * Cleaned up path-or-no-path condition in proxy server get handler * swarm: processed with gofmt refers to lash/go-ethereum@90daa7a * swarm: Added public access method Parse alias to parse * swarm: processed with gofmt References nolash/go-ethereum@2ec3fd7 * Rename parse to Parse, removed alias --- swarm/api/manifest.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'swarm/api/manifest.go') diff --git a/swarm/api/manifest.go b/swarm/api/manifest.go index d6dc24c48..36c0b0436 100644 --- a/swarm/api/manifest.go +++ b/swarm/api/manifest.go @@ -302,7 +302,8 @@ func (self *manifestTrie) findPrefixOf(path string, quitC chan bool) (entry *man if (len(path) >= epl) && (path[:epl] == entry.Path) { glog.V(logger.Detail).Infof("entry.ContentType = %v", entry.ContentType) if entry.ContentType == manifestType { - if self.loadSubTrie(entry, quitC) != nil { + err := self.loadSubTrie(entry, quitC) + if err != nil { return nil, 0 } entry, pos = entry.subtrie.findPrefixOf(path[epl:], quitC) @@ -312,8 +313,6 @@ func (self *manifestTrie) findPrefixOf(path string, quitC chan bool) (entry *man } else { pos = epl } - } else { - entry = nil } return } -- cgit v1.2.3