mirror of
https://github.com/restic/restic.git
synced 2026-11-21 21:12:42 +00:00
repository: prevent header overfill
This commit is contained in:
1 parent
6a6d313c9a
commit
1e3f05c3f1
2 files changed
+9
-2
No files matched your search
@@ -157,6 +157,13 @@ func (p *Packer) Count() int {
|
||||
return len(p.blobs)
|
||||
}
|
||||
|
||||
// HeaderFull returns true if the pack header is full.
|
||||
func (p *Packer) HeaderFull() bool {
|
||||
p.m.Lock()
|
||||
defer p.m.Unlock()
|
||||
return headerSize+uint(len(p.blobs)+1)*entrySize > MaxHeaderSize
|
||||
}
|
||||
|
||||
// Blobs returns the slice of blobs that have been written.
|
||||
func (p *Packer) Blobs() []restic.Blob {
|
||||
p.m.Lock()
|
||||
|
||||
Reference in new issue
Block a user