Skip to content

Commit

Permalink
feat: add content-length for download message (#371)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Aug 16, 2024
1 parent 75e49e0 commit 1da3a9e
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 106 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dragonfly-api"
version = "2.0.148"
version = "2.0.149"
authors = ["Gaius <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
217 changes: 116 additions & 101 deletions pkg/apis/common/v2/common.pb.go

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions pkg/apis/common/v2/common.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion pkg/apis/common/v2/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,14 @@ message Download {
bool need_back_to_source = 14;
// certificate_chain is the client certs with DER format for the backend client to download back-to-source.
repeated bytes certificate_chain = 15;
// prefetch pre-downloads all pieces of the task when download task with range request.
// Prefetch pre-downloads all pieces of the task when download task with range request.
bool prefetch = 16;
// Object Storage related information.
optional ObjectStorage object_storage = 17;
// Content length of the task. If add this field, the task content length will be used the value of this field,
// otherwise the dfdaemon will call the head request to get the task content length.
// Set field of the task content length to skip the head request.
optional uint64 content_length = 18;
}

// Object Storage related information.
Expand Down
6 changes: 5 additions & 1 deletion proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,14 @@ message Download {
bool need_back_to_source = 14;
// certificate_chain is the client certs with DER format for the backend client to download back-to-source.
repeated bytes certificate_chain = 15;
// prefetch pre-downloads all pieces of the task when download task with range request.
// Prefetch pre-downloads all pieces of the task when download task with range request.
bool prefetch = 16;
// Object Storage related information.
optional ObjectStorage object_storage = 17;
// Content length of the task. If add this field, the task content length will be used the value of this field,
// otherwise the dfdaemon will call the head request to get the task content length.
// Set field of the task content length to skip the head request.
optional uint64 content_length = 18;
}

// Object Storage related information.
Expand Down
7 changes: 6 additions & 1 deletion src/common.v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,17 @@ pub struct Download {
/// certificate_chain is the client certs with DER format for the backend client to download back-to-source.
#[prost(bytes = "vec", repeated, tag = "15")]
pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
/// prefetch pre-downloads all pieces of the task when download task with range request.
/// Prefetch pre-downloads all pieces of the task when download task with range request.
#[prost(bool, tag = "16")]
pub prefetch: bool,
/// Object Storage related information.
#[prost(message, optional, tag = "17")]
pub object_storage: ::core::option::Option<ObjectStorage>,
/// Content length of the task. If add this field, the task content length will be used the value of this field,
/// otherwise the dfdaemon will call the head request to get the task content length.
/// Set field of the task content length to skip the head request.
#[prost(uint64, optional, tag = "18")]
pub content_length: ::core::option::Option<u64>,
}
/// Object Storage related information.
#[derive(serde::Serialize, serde::Deserialize)]
Expand Down
Binary file modified src/descriptor.bin
Binary file not shown.

0 comments on commit 1da3a9e

Please sign in to comment.