Clean up stderr logging
This commit is contained in:
@@ -32,8 +32,8 @@ var (
|
||||
)
|
||||
|
||||
var (
|
||||
oidSCTList = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 4, 2}
|
||||
oidCTPoison = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 4, 3}
|
||||
oidSCTList = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 4, 2}
|
||||
oidCTPoison = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 4, 3}
|
||||
)
|
||||
|
||||
// CTLogInfo holds details about a CT log from the log list.
|
||||
@@ -162,6 +162,7 @@ type DumpResult struct {
|
||||
|
||||
// FetchURL fetches data from a URL.
|
||||
func FetchURL(url string) ([]byte, error) {
|
||||
fmt.Fprintf(os.Stderr, "Fetching: %s\n", url)
|
||||
resp, err := http.Get(url)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -184,9 +185,7 @@ func FetchTile(url string) ([]byte, error) {
|
||||
// On 404, try stripping the partial-tile suffix (.p/NNN)
|
||||
if err.Error() == "HTTP 404" {
|
||||
if idx := strings.Index(url, ".p/"); idx != -1 {
|
||||
fullURL := url[:idx]
|
||||
fmt.Fprintf(os.Stderr, "Partial tile not found, trying full tile: %s\n", fullURL)
|
||||
return FetchURL(fullURL)
|
||||
return FetchURL(url[:idx])
|
||||
}
|
||||
}
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user