pub struct Limits {
pub request_bytes: Option<usize>,
pub object_bytes: Option<usize>,
pub walk_bytes: Option<usize>,
}Expand description
The ceilings one connection serves under.
Every field defaults to Some. See the module docs for why that is the
whole point.
Fields§
§request_bytes: Option<usize>Bytes of pkt-line payload gunnar will hold for one request before it
refuses. None removes the ceiling.
object_bytes: Option<usize>Bytes of a single object gunnar will put in a pack. None removes the
ceiling.
walk_bytes: Option<usize>Bytes of object bookkeeping one traversal may hold. None removes the
ceiling.
Charged at WALK_BYTES_PER_OBJECT against the ids live in the
walk, which is not the same as the ids it has emitted — see
crate::DEFAULT_BUDGET for the three separate accumulators the object
count used to charge and the fourth it charged not at all.
Implementations§
Source§impl Limits
impl Limits
Sourcepub fn request_bytes(self, limit: usize) -> Self
pub fn request_bytes(self, limit: usize) -> Self
Cap the bytes held for one peer-supplied request.
Sourcepub fn object_bytes(self, limit: usize) -> Self
pub fn object_bytes(self, limit: usize) -> Self
Cap a single object’s size.
Sourcepub fn walk_bytes(self, limit: usize) -> Self
pub fn walk_bytes(self, limit: usize) -> Self
Cap the object bookkeeping one traversal may hold.
Sourcepub fn no_alloc_limit(self) -> Self
pub fn no_alloc_limit(self) -> Self
Remove all the ceilings entirely.
Only for a peer whose bytes are trusted and a repository whose contents
are known: a local gunnar mirror between two directories on the same
box, or a benchmark that is measuring what the ceiling costs.
Never on a path that answers the network. Both sizes this guards are
chosen by somebody other than the server — one by the peer framing the
request, one by whoever pushed the object — which is the same reason
gunnar_pack::IndexOptions::no_alloc_limit carries the same warning.