Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Unified Diff: client/cmd/logdog_cat/coordinatorSource.go

Issue 1672833003: LogDog: Add log rendering view. Base URL: https://github.com/luci/luci-go@master
Patch Set: Clean up, add tests, little reorg. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/logdog/coordinator/service.go ('k') | common/logdog/coordinator/stream_params.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/cmd/logdog_cat/coordinatorSource.go
diff --git a/client/cmd/logdog_cat/coordinatorSource.go b/client/cmd/logdog_cat/coordinatorSource.go
index 394eaca455eac05eff9bb5114215d641e46342ed..64494cce9d3a26db1655a19903a77e4161cfe75a 100644
--- a/client/cmd/logdog_cat/coordinatorSource.go
+++ b/client/cmd/logdog_cat/coordinatorSource.go
@@ -6,6 +6,7 @@ package main
import (
"errors"
+ "math"
"sync"
"time"
@@ -42,7 +43,16 @@ func (s *coordinatorSource) LogEntries(c context.Context, req *fetcher.LogReques
s.Lock()
defer s.Unlock()
- p := coordinator.NewGetParams().Limit(int(req.Bytes), req.Count).Index(req.Index)
+ // Limit our constraints to int32.
+ bytes, count := req.Bytes, req.Count
+ if bytes > math.MaxInt32 {
+ bytes = math.MaxInt32
+ }
+ if count > math.MaxInt32 {
+ count = math.MaxInt32
+ }
+
+ p := coordinator.NewGetParams().Limit(int32(bytes), int32(count)).Index(req.Index)
// If we haven't terminated, use this opportunity to fetch/update our stream
// state.
« no previous file with comments | « appengine/logdog/coordinator/service.go ('k') | common/logdog/coordinator/stream_params.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698