Skip to content

Commit 41437aa

Browse files
committed
fix merge conflicts
Signed-off-by: Yoshua Wuyts <[email protected]>
1 parent e8245b5 commit 41437aa

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

examples/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async fn accept(addr: String, stream: TcpStream) -> Result<(), async_h1::Excepti
1414
// TODO: Delete this line when we implement `Clone` for `TcpStream`.
1515
let stream = Stream(Arc::new(stream));
1616

17-
server::connect(&addr, stream.clone(), stream, |_| {
17+
server::accept(&addr, stream.clone(), stream, |_| {
1818
async {
1919
let resp = Response::new(StatusCode::Ok)
2020
.set_header("Content-Type", "text/plain")?

src/server.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ use std::pin::Pin;
1515

1616
use crate::{Exception, MAX_HEADERS};
1717

18-
pub async fn connect<R, W, F, Fut>(
18+
/// Parse an incoming HTTP connection.
19+
///
20+
/// Supports `KeepAlive` requests by default.
21+
pub async fn accept<R, W, F, Fut>(
1922
addr: &str,
2023
reader: R,
2124
mut writer: W,
@@ -80,7 +83,7 @@ where
8083
///
8184
/// This is returned from [`encode`].
8285
#[derive(Debug)]
83-
pub struct Encoder {
86+
struct Encoder {
8487
/// Keep track how far we've indexed into the headers + body.
8588
cursor: usize,
8689
/// HTTP headers to be sent.

0 commit comments

Comments
 (0)