1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! HTTP 2xx success response processor
//!
//! Processes HTTP responses after header parsing and determines the next action
//! for the download engine. This is the Rust equivalent of C++ aria2's
//! `HttpResponseCommand::executeInternal()`, covering:
//!
//! - **Protocol validation** (mirrors C++ `HttpResponse::validateResponse()`)
//! - 304 Not Modified handling (mark all pieces done)
//! - Metalink/HTTP Link header processing (alternate URIs)
//! - Digest header processing (checksum verification)
//! - Range validation (Content-Range vs requested range)
//! - Filename determination (Content-Disposition / URL path)
//! - Content-encoding detection (gzip/deflate disables segmented download)
//! - Zero-length file handling
//! - HEAD -> GET method switching
//! - Connection persistence (keep-alive) detection
//! - Unique protocol URI cleanup
//!
//! # Design
//!
//! Unlike the C++ command pattern which creates new command objects and adds them
//! to the download engine, this module returns structured `ResponseProcessResult`
//! values. The caller (download engine / connection handler) interprets the
//! result and takes appropriate action. This is more Rust-idiomatic and avoids
//! the complexity of the C++ command allocation lifecycle.
//!
//! # Module layout
//!
//! - [`types`] -- `ResponseProcessResult` and `ResponseProcessorConfig`
//! - [`processor`] -- `HttpResponseProcessor` (main entry point)
//! - [`validate`] -- `validate_response()` (protocol-level validation)
//! - [`connection`] -- Keep-alive and content-encoding helpers
//! - [`filename`] -- Filename determination from Content-Disposition / URL
//! - [`range`] -- Range validation and Content-Range parsing
//! - [`conversion`] -- HttpResponseHead-to-HttpResponse bridge
// Re-export public API so external consumers can use
// `response_processor::HttpResponseProcessor` etc. without knowing the
// internal file layout.
pub use ;
pub use determine_filename;
pub use determine_filename_from_response;
pub use HttpResponseProcessor;
pub use validate_response_range;
pub use ;
pub use ;