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
58
59
60
61
62
63
64
65
66
67
//! Per-connection hyper seam for [`crate::http::server`].
//!
//! Exists to keep the accept loop free of hyper / tower wiring details.
//! Composition of the actual layer stack lives one module over in
//! [`super::stack`] (see Slice B of #182 — issue #184). This file only owns:
//!
//! * the hyper `http1::Builder` configuration,
//! * the body-normalisation `MapRequestBodyLayer` at the hyper → tower
//! seam (ADR-014 D2 / #175),
//! * the per-bistream `tracing` site for hyper connection errors.
use TokioIo;
use TowerToHyperService;
use ServiceBuilder;
pub use ServeService;
use crateIrohStream;
use crateBody;
/// Drive a single hyper HTTP/1.1 connection over `io` with a pre-built
/// tower stack.
///
/// Returns the future. The accept loop spawns it; this function neither
/// spawns nor logs any lifecycle event of its own (drop guards live in the
/// caller's task). Connection-level errors are logged at `debug!` level
/// because most of them are routine end-of-life conditions on a P2P
/// transport (peer reset, idle timeout, decoder rejection of malformed
/// inbound bytes) — promoting them to `warn` would flood operators with
/// noise. Layer-side service errors that *do* warrant escalation are
/// surfaced via `HandleLayerErrorLayer`, which converts them into
/// structured HTTP responses before they ever reach this point.
///
/// `effective_header_limit` configures the hyper `http1::Builder`'s
/// `max_buf_size`; it is **not** part of [`super::stack::StackConfig`]
/// because it is a hyper framing knob, not a tower layer.
pub async