Skip to content

Commit

Permalink
capnp: fix read limit zeroing bug in Message.Reset
Browse files Browse the repository at this point in the history
  • Loading branch information
zombiezen committed Jul 11, 2017
1 parent b824eaf commit 2124595
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mem.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ func (m *Message) Reset(arena Arena) {
m.segs = nil
m.firstSeg = Segment{}
m.mu.Unlock()
m.ReadLimiter().Reset(m.TraverseLimit)
if m.TraverseLimit == 0 {
m.ReadLimiter().Reset(defaultTraverseLimit)
} else {
m.ReadLimiter().Reset(m.TraverseLimit)
}
}

// Root returns the pointer to the message's root object.
Expand Down

0 comments on commit 2124595

Please sign in to comment.