pub struct Limits {
pub max_block_size: u16,
pub max_length: Option<u64>,
pub min_length: Option<u64>,
pub require_definite_length: bool,
pub allow_start_offset: bool,
pub available: Option<u64>,
pub busy: bool,
}Expand description
What a Responder will agree to.
Every field is a reason §11.22.5.1 gives for rejecting an Init, turned into a number the application sets once instead of a check it has to remember to write.
Fields§
§max_block_size: u16The largest block this node will handle. The negotiated size is the smaller of this and the Initiator’s proposal.
max_length: Option<u64>The largest definite length to accept — LENGTH_TOO_LARGE past it.
min_length: Option<u64>The smallest definite length that makes sense here — LENGTH_TOO_SHORT under it.
require_definite_length: boolWhether a transfer may proceed without a definite length — LENGTH_REQUIRED if not.
allow_start_offset: boolWhether a non-zero start offset is supported — START_OFFSET_NOT_SUPPORTED if not.
§11.22.5.1.3: “Receivers are not required to accept non-zero start offset transfers. Devices SHOULD make every attempt to support non-zero start offset.”
available: Option<u64>How much data this node actually has past the start offset, for a
Download.
§11.22.5.4.4 is the reason this exists: the accepted length is the proposed one only when the file is that big, and “smaller than the proposed definite length, if the remaining data in the file beyond the Start Offset is smaller than the proposed length”.
busy: boolWhether to turn the transfer away with RESPONDER_BUSY. §11.22.5.1: an Initiator
“SHOULD wait at least 60 seconds” before trying again.