Commit Graph

26 Commits

Author SHA1 Message Date
Sean McArthur
740654e55d refactor(error): improve error message when user body ends early 2022-03-14 10:31:31 -07:00
Jonas Platte
a81c44f2c8 refactor(lib): Import tracing macros per-module
Instead of one #[macro_use] at the crate root.
2021-08-31 16:35:52 -07:00
Taiki Endo
f0ddb66932 refactor(lib): apply unreachable_pub lint (#2400)
Closes #2390
2021-01-14 09:57:55 -08:00
Sean McArthur
fad42acc79 feat(lib): Upgrade to Tokio 1.0 (#2369)
Closes #2370
2020-12-23 10:36:12 -08:00
Pankaj Chaudhary
3b3077da1f refactor(http1): updated Encoder/Decoder match with the matches macro (#2368) 2020-12-22 10:50:57 -08:00
Eliza Weisman
751c122589 feat(lib): update bytes to 0.6, update http-body (#2339)
This branch updates `bytes` and `http-body` to the latest versions. The
`http-body` version that uses `bytes` 0.6 hasn't been released yet, so
we depend on it via a git dep for now. Presumably Hyper and `http-body`
will synchronize their releases.

Other than that, this is a pretty mechanical update. Should fix the
build and unblock the `h2` update to use vectored writes.
2020-11-19 16:23:32 -08:00
Sean McArthur
bdb5e5d694 feat(server): Make the server code an optional feature (#2334)
cc #2223 

BREAKING CHANGE: The HTTP server code is now an optional feature. To
  enable the server, add `features = ["server"]` to the dependency in
  your `Cargo.toml`.
2020-11-18 11:02:20 -08:00
Eliza Weisman
71f3402421 fix(http1): ending close-delimited body should close (#2322)
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-11-06 15:38:01 -08:00
João Oliveira
1ecbcbb119 fix(http1): return error if user body ends prematurely
- update proto::h1::end_body to return Result<()>
- update Encoder::end to return Error(NotEof) only when there's Content-length left to be addressed

Closes #2263
2020-08-12 14:12:48 -07:00
Dirkjan Ochtman
aac0e2dd57 refactor(body): use HttpBody with extra bounds instead of Payload trait 2020-05-14 13:26:39 -07:00
danieleades
0eaf304644 style(lib): address most clippy lints 2020-01-03 09:40:32 -08:00
Vivek Ghaisas
35825c4614 style(comments): correct some typos in Rust code comments 2019-12-20 10:16:36 -08:00
Sean McArthur
0dc89680cd style(lib): run rustfmt and enforce in CI 2019-12-05 13:55:17 -08:00
Sean McArthur
cb3f39c2dc feat(lib): update Tokio, bytes, http, h2, and http-body 2019-12-04 10:56:34 -08:00
lzutao
fc7f81b67c style(lib): use rust 2018 edition idioms (#1910) 2019-08-21 11:22:07 -07:00
Sean McArthur
da9b0319ef refactor(lib): update to 2018 edition 2019-07-09 15:16:01 -07:00
Sean McArthur
898e919504 perf(h1): optimize for when Body is only 1 chunk
- When the `Body` is created from a buffer of bytes (such as
  `Body::from("hello")`), we can skip some bookkeeping that is
  normally required for streaming bodies.
- Orthogonally, optimize encoding body chunks when the strategy
  is to flatten into the headers buf, by skipping the EncodedBuf
  enum.
2018-05-31 19:27:24 -07:00
Sean McArthur
26417fc24a perf(h1): improve parsing and encoding of http1 messages 2018-05-15 13:24:58 -07:00
Sean McArthur
5680f6fca0 perf(h1): optimize header encoding 2018-05-07 18:04:58 -07:00
Sean McArthur
bf4fe7c515 perf(h1): remove book keeping on final body writes 2018-05-07 12:48:21 -07:00
Sean McArthur
8f0e01f853 perf(h1): poll body less if is_end_stream 2018-05-07 12:09:15 -07:00
Sean McArthur
d58aa73246 feat(server): add upgrade support to lower-level Connection API (#1459)
Closes #1323
2018-03-09 10:05:27 -08:00
Sean McArthur
c33b9d4e16 refactor(proto): move more h1-specific pieces into h1 module 2018-01-25 14:40:09 -08:00
Sean McArthur
68377ede70 perf(http): utilize writev when possible
By using `AsyncWrite::write_buf`, we can avoid some copies in some
cases. This especially helps throughput for chunked encoding.
2018-01-25 14:02:11 -08:00
Sean McArthur
36e66a5054 fix(lib): properly handle HTTP/1.0 remotes
- Downgrades internal semantics to HTTP/1.0 if peer sends a message with
  1.0 version.
- If downgraded, chunked writers become EOF writers, with the connection
  closing once the writing is complete.
- When downgraded, if keep-alive was wanted, the `Connection: keep-alive`
  header is added.

Closes #1304
2018-01-22 10:08:27 -08:00
Sean McArthur
5027435791 refactor(lib): rename internal http module to proto 2017-09-28 18:28:44 -07:00