Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ scalable file sharing capabilities.
- **Cache Piece Content (Tag=0x07):** Raw cache piece data or cache piece fragments.
- **Error (Tag=0xFF):** Conveys error.
- **Close (Tag=0xFE):** Indicates the end of a connection.
- **Reserved Tags:** Tags 6-253 may be allocated for metadata, compression, encryption, or future protocol extensions.
- **Reserved Tags:** Tags 8-253 may be allocated for metadata, compression, encryption, or future protocol extensions.

## Example

Expand Down
9 changes: 4 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,15 @@ impl From<Header> for Bytes {
/// Packet Format:
/// - Packet Identifier (1 bytes): Uniquely identifies each packet
/// - Tag (1 bytes): Specifies data type in value field
/// - Length (8 bytes): Indicates Value field length, up to 4 GiB
/// - Value (variable): Actual data content, maximum 1 GiB
/// - Length (4 bytes): Indicates Value field length, up to 4 GiB
/// - Value (variable): Actual data content, maximum 4 GiB
///
/// Protocol Format:
///
/// ```text
/// ---------------------------------------------------------------------------------------------------
/// | | | | |
/// | Packet Identifier (1 bytes) | Tag (1 bytes) | Length (8 bytes) | Value (up to 4 GiB) |
/// | Packet Identifier (1 bytes) | Tag (1 bytes) | Length (4 bytes) | Value (up to 4 GiB) |
/// | | | | |
/// ---------------------------------------------------------------------------------------------------
/// ```
Expand Down Expand Up @@ -374,7 +374,7 @@ impl TryFrom<Bytes> for Vortex {
}
}

/// Implement From<PieceContent> for Bytes.
/// Implement From<Vortex> for Bytes.
impl From<Vortex> for Bytes {
/// from converts a Vortex packet to Bytes.
fn from(packet: Vortex) -> Self {
Expand Down Expand Up @@ -471,7 +471,6 @@ mod tests {

assert_eq!(header.tag, tag);
assert_eq!(header.length, value_length);
assert!(header.id <= 254);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/tlv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub enum Tag {
/// The content of a cache piece, with a maximum size of 4 GiB per piece.
CachePieceContent = 7,

/// Reserved for future use, for tags 6-254.
/// Reserved for future use, for tags 8-253.
Reserved(u8),

/// Close the connection. If server or client receives this tag, it will close the connection.
Expand Down
Loading