Fix bug when fetching entries
This bug caused certspotter to always request 1000 entries even if went beyond the size of the log. This would have prevented certspotter from downloading entries near the end of the log, if the log was strict with get-entries bounds. In practice, none of the active CT logs are strict with get-entries bounds, and even if a log were strict, certspotter would have been able to successfully download the entries later once the log grew.
This commit is contained in:
parent
b957791a5f
commit
e2b5a8c8ea
|
@ -234,7 +234,7 @@ func monitorLog(ctx context.Context, config *Config, ctlog *loglist.Log, logClie
|
||||||
|
|
||||||
func downloadEntries(ctx context.Context, logClient *client.LogClient, entriesChan chan<- client.GetEntriesItem, begin, end uint64) error {
|
func downloadEntries(ctx context.Context, logClient *client.LogClient, entriesChan chan<- client.GetEntriesItem, begin, end uint64) error {
|
||||||
for begin < end && ctx.Err() == nil {
|
for begin < end && ctx.Err() == nil {
|
||||||
size := begin - end
|
size := end - begin
|
||||||
if size > maxGetEntriesSize {
|
if size > maxGetEntriesSize {
|
||||||
size = maxGetEntriesSize
|
size = maxGetEntriesSize
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue