Chromium Code Reviews| 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 |
| + } |
|
Ryan Tseng
2016/02/08 22:56:55
log warning?
dnj (Google)
2016/02/09 02:50:03
No need. The "bytes" and "count" parameters are pe
|
| + 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. |