fetchTemplateLevel recorded a hash for tiles it already held but not for the ones it had just fetched, so a fresh Piggyback survey read its first level as empty and stopped. IGN's pyramid never looks at the hashes, which is how the omission crawled a whole map without being noticed.
- commit
- ecce87aa1c51b67e377ea47c75ea0d1bb754fabc
- parent
- 85036ba78239ccaf042a4e99f0ed17a3201e87cb
- author
- Dami <dami.etoile@gmail.com>
| M | tools/ | 4 | +++- |
@@ -457,16 +457,18 @@ func fetchTemplateLevel(
457457 failure = err458458 return459459 }460+ hash := hashBytes(body)460461 index.put(tileRecord{461462 URL: url, Status: "cached", TileSetID: setID,462463 Zoom: zoom, X: coordinate[0], Y: coordinate[1],463- ContentHash: hashBytes(body), ContentType: contentType,464+ ContentHash: hash, ContentType: contentType,464465 ByteLength: len(body),465466 CoverageKey: fmt.Sprintf("%d:%d:%d:%d:%d",466467 index.mapID, setID, zoom, coordinate[0], coordinate[1]),467468 })468469 result.fetched++469470 result.bytes += int64(len(body))471+ result.hashes[coordinate] = hash470472 }(coordinate, url, path)471473 }472474 group.Wait()