[ARVADOS] updated: df05c261c2b3b3a20f77dcaf8d481a5a113e67e8
git at public.curoverse.com
git at public.curoverse.com
Fri Apr 11 17:49:12 EDT 2014
Summary of changes:
services/keep/keep.go | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
via df05c261c2b3b3a20f77dcaf8d481a5a113e67e8 (commit)
via 2b571044517c19a2d3d20e5d4a3197a653667425 (commit)
via db59e780872b7e7e5c9b1ee94f8e0ae136043d74 (commit)
from 75df7deca434d9b3b161dc2d7d13ae21b1fe4b08 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit df05c261c2b3b3a20f77dcaf8d481a5a113e67e8
Merge: 75df7de 2b57104
Author: Tim Pierce <twp at curoverse.com>
Date: Fri Apr 11 17:51:04 2014 -0400
Merge branch '2449-keep-write-blocks' into 2449-keep-index-status-handlers
diff --cc services/keep/keep.go
index 8683abf,9c44826..1ea8240
--- a/services/keep/keep.go
+++ b/services/keep/keep.go
@@@ -505,5 -361,20 +504,19 @@@ func FreeDiskSpace(volume string) (fre
// space in terms of 1K blocks.
free = fs.Bavail * uint64(fs.Bsize) / 1024
}
-
return
}
+
+ // ReadAtMost
+ // Returns a byte slice containing at most N bytes read
+ // from the specified io.Reader.
+ //
+ func ReadAtMost(r io.Reader, limit int) ([]byte, error) {
+ // Attempt to read one more byte than limit.
+ lr := io.LimitReader(r, int64(limit+1))
+ buf, err := ioutil.ReadAll(lr)
+ if len(buf) > limit {
+ return buf[:limit], errors.New("Request Too Large")
+ }
+ return buf, err
+ }
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list